示例#1
0
 def test_test(self):
     self.assertFalse(CharacterWithoutBoolean.test(
         ['Character', 'Boolean'], []
     ))
     self.assertTrue(CharacterWithoutBoolean.test(
         ['Character', 'Postal Code'], []
     ))
示例#2
0
    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))
示例#3
0
    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))
示例#4
0
 def test_test(self):
     self.assertFalse(
         CharacterWithoutBoolean.test(['Character', 'Boolean'], []))
     self.assertTrue(
         CharacterWithoutBoolean.test(['Character', 'Postal Code'], []))