def test_split_quotes(self): s = "1,2,3,'Once, upon a time, something happened',6" self.assertListEqual( ["1", "2", "3", "'Once, upon a time, something happened'", "6"], CvtdUtil.split_quotes(s, ',')) s2 = '"3,3","4,4","5,5"\n' self.assertListEqual(['"3,3"', '"4,4"', '"5,5"\n'], CvtdUtil.split_quotes(s2, ','))
def test_split_quotes_empty_field(self): s = "2,3,'boo',,\"hello\",,7" self.assertListEqual(["2", "3", "'boo'", "", "\"hello\"", "", "7"], CvtdUtil.split_quotes(s, ','))