def lines(self): try: csv = util.urlopen_lines(self.source.url) return udr.UnicodeDictReader(csv) except udr.EmptyCSVError as e: self.log_exception(e) return ()
def test_urlopen_lines(urlopen_mock): urlopen_mock.return_value = StringIO("line one\nline two\r\nline three") lines = [line for line in util.urlopen_lines("http://none")] h.assert_equal(lines, ["line one\n", "line two\n", "line three"])