def test_test(self): self.assertFalse(CharacterWithoutBoolean.test( ['Character', 'Boolean'], [] )) self.assertTrue(CharacterWithoutBoolean.test( ['Character', 'Postal Code'], [] ))
def test_normalizer(self): char_result = ParseResult('Character', None, 25) pc_result = ParseResult('Postal Code', None, 80) results = CharacterWithoutBoolean.normalize([char_result, pc_result]) count = 0 for res in results: if res.type == 'Character': count += 1 self.assertEqual(res.confidence, 100) elif res.type == "Postal Code": count += 1 self.assertEqual(res.confidence, 80) self.assertEqual(count, len(results))
def test_test(self): self.assertFalse( CharacterWithoutBoolean.test(['Character', 'Boolean'], [])) self.assertTrue( CharacterWithoutBoolean.test(['Character', 'Postal Code'], []))