コード例 #1
0
 def test_UseOnlyFirstRegexTrue(self):
     self.assertEqual(
         True,
         DatabaseHelper.useOnlyFirstRegexTrue(417, 'Aerospace Engineering'))
     self.assertEqual(
         True, DatabaseHelper.useOnlyFirstRegexTrue(417, 'Engineering'))
     self.assertEqual(
         False, DatabaseHelper.useOnlyFirstRegexTrue(417, 'Aerospace'))
     self.assertEqual(False,
                      DatabaseHelper.useOnlyFirstRegexTrue(417, 'Cat'))
コード例 #2
0
 def test_UseAllRegexAndRegexHelper(self):
     self.assertEqual(
         True,
         DatabaseHelper.useAllRegexAndRegexHelper(417,
                                                  'Aerospace Engineering'))
     self.assertEqual(
         False,
         DatabaseHelper.useAllRegexAndRegexHelper(417, 'Aerospace Cats'))
     self.assertEqual(
         False,
         DatabaseHelper.useAllRegexAndRegexHelper(417, 'Engineering Cats'))
コード例 #3
0
    def __init__(self, stringToScan, attributeId):

        self.attributeId = attributeId
        self.IsMatched = False
        self.stringToScan = stringToScan
        self.searchCriteria = DatabaseHelper.getOnlyOneRegex(self.attributeId)
        Parser.__init__(self, stringToScan, self.searchCriteria)
        self.IsMatched = self.doesMatchExist()
コード例 #4
0
 def test_UseOnlyFirstRegexFalseRegexHelperFalse(self):
     self.assertEqual(
         True,
         DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(
             417, 'Cat Pigeon'))
     self.assertEqual(
         False,
         DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(
             417, 'Aerospace Engineering'))
     self.assertEqual(
         False,
         DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(
             417, 'Cat Engineering'))
     self.assertEqual(
         False,
         DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(
             417, 'Aerospace Pigeon'))
コード例 #5
0
 def test_DatabaseHelperOnlyFirstRegex(self):
     self.assertEqual(
         True, DatabaseHelper.UseOnlyFirstRegex(417,
                                                'Aerospace Engineering'))
     self.assertEqual(False, DatabaseHelper.UseOnlyFirstRegex(417, 'Cats'))
コード例 #6
0
 def test_UseAllRegex(self):
     self.assertEqual(
         True, DatabaseHelper.useAllRegex(417, 'Aerospace Engineering'))
コード例 #7
0
 def test_DatabaseHelperOnlyFirstRegexHelper(self):
     self.assertEqual(True, DatabaseHelper.useOnlyOneRegexHelper(417, 'Aerospace Engineering'))
     self.assertEqual(False, DatabaseHelper.useOnlyOneRegexHelper(417, 'Cats'))
コード例 #8
0
 def test_UseOnlyFirstRegexFalseRegexHelperFalse(self):
     self.assertEqual(True, DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(417, 'Cat Pigeon'))
     self.assertEqual(False, DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(417, 'Aerospace Engineering'))
     self.assertEqual(False, DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(417, 'Cat Engineering'))
     self.assertEqual(False, DatabaseHelper.useOnlyFirstRegexFalseRegexHelperFalse(417, 'Aerospace Pigeon'))
コード例 #9
0
 def test_UseOnlyFirstRegexTrueRegexHelperTrue(self):
     self.assertEqual(True, DatabaseHelper.useOnlyFirstRegexTrueRegexHelperTrue(417, 'Aerospace Engineering'))
     self.assertEqual(False, DatabaseHelper.useOnlyFirstRegexTrueRegexHelperTrue(417, 'Engineering'))
     self.assertEqual(False, DatabaseHelper.useOnlyFirstRegexTrueRegexHelperTrue(417, 'Aerospace'))
     self.assertEqual(False, DatabaseHelper.useOnlyFirstRegexTrueRegexHelperTrue(417, 'Cat'))
コード例 #10
0
 def test_UseAllRegexAndRegexHelper(self):
     self.assertEqual(True, DatabaseHelper.useAllRegexAndRegexHelper(417, 'Aerospace Engineering'))
     self.assertEqual(False, DatabaseHelper.useAllRegexAndRegexHelper(417, 'Aerospace Cats'))
     self.assertEqual(False, DatabaseHelper.useAllRegexAndRegexHelper(417, 'Engineering Cats'))
コード例 #11
0
 def test_UseAllRegex(self):
     self.assertEqual(True, DatabaseHelper.useAllRegex(417, 'Aerospace Engineering'))