Пример #1
0
 def test_bad_inputs(self):
     with self.assertRaises(AssertionError):
         at_analysis.ATResult("name", False, 0.5)
     with self.assertRaises(AssertionError):
         at_analysis.ATResult("name", "good", 0)
     with self.assertRaises(AssertionError):
         at_analysis.ATResult("name", "good", "str")
     with self.assertRaises(AssertionError):
         at_analysis.ATResult(False, "good", 0.5)
Пример #2
0
 def test_construction(self):
     result = at_analysis.ATResult("a", "b", 0.9)
     assert result.score == 0.9
     assert result.name == "a"
     assert result.signature == "b"
Пример #3
0
 def test_json(self):
     result = at_analysis.ATResult("a", "b", 0.9)
     regenned = at_analysis.ATResult.from_json(result.to_json())
     assert result.score == regenned.score
     assert result.name == regenned.name
     assert result.signature == regenned.signature