def test_parse_line_5(self): line = 'Englebert G. Humperdink, red, 36410, 839 014 8051' document = parse_line(line) self.assertEquals(document, {'color': 'red', 'lastname': 'Humperdink', 'phonenumber': '839-014-8051', 'zipcode': '36410', 'firstname': 'Englebert G.'})
def test_parse_line_4(self): line = 'asdfawefawea' document = parse_line(line) self.assertEquals(document, None)
def test_parse_line_2(self): line = 'Chandler, Kerri, (623)-668-9293, pink, 123123121' document = parse_line(line) self.assertEquals(document, None)
def test_parse_line_3(self): line = 'James Murphy, yellow, 83880, 018 154 6474' document = parse_line(line) self.assertEquals(document, {'color': 'yellow', 'lastname': 'Murphy', 'phonenumber': '018-154-6474', 'zipcode': '83880', 'firstname': 'James'})
def test_parse_line_1(self): line = 'Booker T., Washington, 87360, 373 781 7380, yellow' document = parse_line(line) self.assertEquals(document, {'color': 'yellow', 'lastname': 'Washington', 'phonenumber': '373-781-7380', 'zipcode': '87360', 'firstname': 'Booker T.'})