소스 검색

tests: fix issue with double-precision TextNode tests

rdb 7 년 전
부모
커밋
c43d9b5002
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  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.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():
@@ -100,7 +100,7 @@ def test_textnode_flatten_colorscale():
     path.set_color_scale(color)
     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))