Example #1
0
    def test_load(self):
        lines=[
'#                  | <---- the 20th column',
'#Tested field:     Date field:   Comment field:',
'NMBR = 809?        032510        BAD AREA CODE',
'SELLING MY SOUL?   ------        1-888-555-1212',
        ]
        it = blacklist()
        it.load(lines)
        self.assertEquals(2, len(it.dict))
Example #2
0
 def test_load(self):
     lines = [
         '#                  | <---- the 20th column',
         '#Tested field:     Date field:   Comment field:',
         'NMBR = 809?        032510        BAD AREA CODE',
         'SELLING MY SOUL?   ------        1-888-555-1212',
     ]
     it = blacklist()
     it.load(lines)
     self.assertEquals(2, len(it.dict))
Example #3
0
    def test_merge_eliminates_duplicates(self):
        lines=[
'#                  | <---- the 20th column',
'#Tested field:     Date field:   Comment field:',
'SELLING MY SOUL?   123456        1-888-555-1212',
'SELLING MY SOUL?   123456        different',
'SELLING MY SOUL?   123457        1-888-555-1212',
        ]
        it = blacklist()
        it.load(lines)
        self.assertEquals(1, len(it.dict))
        newentry = blacklistEntry()
        newentry.fromString('SELLING MY SOUL?   123456        Auto')
        it.merge([ newentry ])
        self.assertEquals(1, len(it.dict))
Example #4
0
 def test_merge_eliminates_duplicates(self):
     lines = [
         '#                  | <---- the 20th column',
         '#Tested field:     Date field:   Comment field:',
         'SELLING MY SOUL?   123456        1-888-555-1212',
         'SELLING MY SOUL?   123456        different',
         'SELLING MY SOUL?   123457        1-888-555-1212',
     ]
     it = blacklist()
     it.load(lines)
     self.assertEquals(1, len(it.dict))
     newentry = blacklistEntry()
     newentry.fromString('SELLING MY SOUL?   123456        Auto')
     it.merge([newentry])
     self.assertEquals(1, len(it.dict))