def setUp(self, mock_get): mock_get.return_value = 'zażółć', '001' self.bank = Bank('00123') self.reply = Reply(self.bank, dateutil.parser.parse('1970-01-01'), True, '/path/to/file')
def test_should_allow_string_date(self): reply = Reply(self.bank, '1970-01-01', False, '/path/to/file') self.assertEqual(self.bank, reply.bank) self.assertEqual('1970-01-01', reply.date) self.assertFalse(reply.has_account) self.assertEqual('/path/to/file', reply.file_path)
def test_date_string_datetime_with_time(self): date = dateutil.parser.parse('1970-01-01T23:59') reply = Reply(self.bank, date, False, '/path/to/file') self.assertEqual('1970-01-01', reply.date_string)
def test_date_string_str(self): reply = Reply(self.bank, '1970-01-01', False, '/path/to/file') self.assertEqual('1970-01-01', reply.date_string)
def test_time_string_datetime_without_time(self): date = dateutil.parser.parse('1970-01-01') reply = Reply(self.bank, date, False, '/path/to/file') self.assertIsNone(reply.time_string)
def test_time_string_str(self): reply = Reply(self.bank, '1970-01-01T23:59', False, '/path/to/file') self.assertIsNone(reply.time_string)