def test_resumed_file(self): f = StringIO() writer = csv_contact_writer(f, True) writer({"msisdn": "1234"}) writer({"msisdn": "5678"}) self.assertEqual(f.getvalue(), "1234\r\n5678\r\n")
def test_new_file(self): f = StringIO() writer = csv_contact_writer(f, False) writer({"msisdn": "1234"}) writer({"msisdn": "5678"}) self.assertEqual(f.getvalue(), "msisdn\r\n1234\r\n5678\r\n")