File tree Expand file tree Collapse file tree 1 file changed +17
-18
lines changed
Expand file tree Collapse file tree 1 file changed +17
-18
lines changed Original file line number Diff line number Diff line change 1- # -*- coding: utf-8 -*-
2-
1+ # pylint: disable=missing-docstring
32import cmudict
43
54
65def test_dict ():
7- EXPECTED_SIZE = 126052
6+ expected_size = 126052
87 d = cmudict .dict ()
9- SIZE = len (d )
10- if EXPECTED_SIZE != SIZE :
8+ actual_size = len (d )
9+ if expected_size != actual_size :
1110 raise AssertionError (
12- "cmudict.dict(): Expected {0 } keys, got {1 }." . format ( EXPECTED_SIZE , SIZE )
11+ f "cmudict.dict(): Expected { expected_size } keys, got { actual_size } ."
1312 )
1413
1514
1615def test_entries ():
17- EXPECTED = 135166
16+ expected_count = 135166
1817 e = cmudict .entries ()
19- COUNT = len (e )
20- if COUNT != EXPECTED :
18+ actual_count = len (e )
19+ if actual_count != expected_count :
2120 raise AssertionError (
22- "cmudict.entries(): Expected {0 } entries, got {1 }." . format ( EXPECTED , COUNT )
21+ f "cmudict.entries(): Expected { expected_count } entries, got { actual_count } ."
2322 )
2423
2524
2625def test_raw ():
27- EXPECTED = 3618488
26+ expected_bytes = 3618488
2827 r = cmudict .raw ()
29- COUNT = len (r )
30- if COUNT != EXPECTED :
28+ actual_bytes = len (r )
29+ if actual_bytes != expected_bytes :
3130 raise AssertionError (
32- "cmudict.raw(): Expected {0 } bytes, got {1 }." . format ( EXPECTED , COUNT )
31+ f "cmudict.raw(): Expected { expected_bytes } bytes, got { actual_bytes } ."
3332 )
3433
3534
3635def test_words ():
37- EXPECTED = 135166
36+ expected_count = 135166
3837 w = cmudict .words ()
39- COUNT = len (w )
40- if COUNT != EXPECTED :
38+ actual_count = len (w )
39+ if actual_count != expected_count :
4140 raise AssertionError (
42- "cmudict.raw (): Expected {0} bytes , got {1 }." . format ( EXPECTED , COUNT )
41+ f "cmudict.words (): Expected { expected_count } words , got { actual_count } ."
4342 )
You can’t perform that action at this time.
0 commit comments