Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30031b5

Browse files
committed
Add tests
1 parent d94a6a5 commit 30031b5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

lib/matplotlib/tests/test_font_manager.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ def test_font_priority():
3131
assert cmap[8729] == 30
3232

3333

34+
def test_ttflist_weight():
35+
assert all(isinstance(f.weight, six.string_types)
36+
for f in fontManager.ttflist)
37+
38+
39+
def test_score_weight():
40+
assert (0 ==
41+
fontManager.score_weight("regular", "regular") ==
42+
fontManager.score_weight("bold", "bold") <
43+
fontManager.score_weight("normal", "regular") ==
44+
fontManager.score_weight(400, 400) <
45+
fontManager.score_weight("normal", "bold"))
46+
47+
3448
def test_json_serialization():
3549
# on windows, we can't open a file twice, so save the name and unlink
3650
# manually...

0 commit comments

Comments
 (0)