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'))
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'))
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()
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'))
def test_DatabaseHelperOnlyFirstRegex(self): self.assertEqual( True, DatabaseHelper.UseOnlyFirstRegex(417, 'Aerospace Engineering')) self.assertEqual(False, DatabaseHelper.UseOnlyFirstRegex(417, 'Cats'))
def test_UseAllRegex(self): self.assertEqual( True, DatabaseHelper.useAllRegex(417, 'Aerospace Engineering'))
def test_DatabaseHelperOnlyFirstRegexHelper(self): self.assertEqual(True, DatabaseHelper.useOnlyOneRegexHelper(417, 'Aerospace Engineering')) self.assertEqual(False, DatabaseHelper.useOnlyOneRegexHelper(417, 'Cats'))
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'))
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'))
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'))
def test_UseAllRegex(self): self.assertEqual(True, DatabaseHelper.useAllRegex(417, 'Aerospace Engineering'))