Skip to content

Commit 75c3081

Browse files
Elijah Rippethfgregg
Elijah Rippeth
authored andcommitted
add broken tests.
1 parent 4db469a commit 75c3081

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

tests/conftest.py

+5-14
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,16 @@ def xseq():
1212
{"clean": 1, "shop": 0.1},
1313
{"walk": 1, "shop": 0.5},
1414
{},
15-
{"clean": 1},
16-
{"солнце": "не светит".encode(), "clean": 1},
15+
{'clean': 1},
16+
{u'солнце': u'не светит'.encode('utf8'), 'clean': 1},
17+
{'world': 2}
1718
]
1819

1920

2021
@pytest.fixture
2122
def yseq():
22-
return [
23-
"sunny",
24-
"sunny",
25-
"sunny",
26-
"rainy",
27-
"rainy",
28-
"rainy",
29-
"sunny",
30-
"sunny",
31-
"rainy",
32-
"rainy",
33-
]
23+
return ['sunny', 'sunny', u'sunny', 'rainy', 'rainy', 'rainy',
24+
'sunny', 'sunny', 'rainy', 'rainy', '好']
3425

3526

3627
@pytest.fixture

tests/test_tagger.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,12 @@ def test_info(model_filename):
171171
with Tagger().open(model_filename) as tagger:
172172
res = tagger.info()
173173

174-
assert res.transitions[("sunny", "sunny")] > res.transitions[("sunny", "rainy")]
175-
assert (
176-
res.state_features[("walk", "sunny")]
177-
> res.state_features[("walk", "rainy")]
178-
)
179-
assert ("солнце:не светит", "rainy") in res.state_features
180-
assert res.header["num_labels"] == "2"
181-
assert set(res.labels.keys()) == {"sunny", "rainy"}
182-
assert set(res.attributes.keys()) == {
183-
"shop", "walk", "clean", "солнце:не светит"
184-
}
174+
assert res.transitions[('sunny', 'sunny')] > res.transitions[('sunny', 'rainy')]
175+
assert res.state_features[('walk', 'sunny')] > res.state_features[('walk', 'rainy')]
176+
assert (u'солнце:не светит', u'rainy') in res.state_features
177+
assert res.header['num_labels'] == '3'
178+
assert set(res.labels.keys()) == set(['sunny', 'rainy', '好'])
179+
assert set(res.attributes.keys()) == set(['shop', 'walk', 'clean', u'солнце:не светит', 'world'])
185180

186181
# it shouldn't segfault on a closed tagger
187182
with pytest.raises(RuntimeError):

0 commit comments

Comments
 (0)