Browse Source

tests: fix issue with double-precision TextNode tests

rdb 7 years ago
parent
commit
c43d9b5002
1 changed files with 8 additions and 8 deletions
  1. 8 8
      tests/text/test_textnode.py

+ 8 - 8
tests/text/test_textnode.py

@@ -82,10 +82,10 @@ def test_textnode_flatten_color():
     path.set_color(color)
     path.set_color(color)
     path.flatten_strong()
     path.flatten_strong()
 
 
-    assert text.text_color == color
-    assert text.shadow_color == color
-    assert text.frame_color == color
-    assert text.card_color == color
+    assert text.text_color.almost_equal(color)
+    assert text.shadow_color.almost_equal(color)
+    assert text.frame_color.almost_equal(color)
+    assert text.card_color.almost_equal(color)
 
 
 
 
 def test_textnode_flatten_colorscale():
 def test_textnode_flatten_colorscale():
@@ -100,7 +100,7 @@ def test_textnode_flatten_colorscale():
     path.set_color_scale(color)
     path.set_color_scale(color)
     path.flatten_strong()
     path.flatten_strong()
 
 
-    assert text.text_color == (.5, 0, 0, 0)
-    assert text.shadow_color == (0, .5, 0, 0)
-    assert text.frame_color == (0, 0, .5, 0)
-    assert text.card_color == (0, 0, 0, .5)
+    assert text.text_color.almost_equal((.5, 0, 0, 0))
+    assert text.shadow_color.almost_equal((0, .5, 0, 0))
+    assert text.frame_color.almost_equal((0, 0, .5, 0))
+    assert text.card_color.almost_equal((0, 0, 0, .5))