def test_parse_calendar_day(self): date = _parse_calendar_day('1981-04-05') self.assertEqual(date.year, 1981) self.assertEqual(date.month, 4) self.assertEqual(date.day, 5) date = _parse_calendar_day('19810405') self.assertEqual(date.year, 1981) self.assertEqual(date.month, 4) self.assertEqual(date.day, 5)
def test_parse_calendar_day(self): testtuples = (('1981-04-05', {'YYYY': '1981', 'MM': '04', 'DD': '05'}), ('19810405', {'YYYY': '1981', 'MM': '04', 'DD': '05'})) for testtuple in testtuples: mockBuilder = mock.Mock() mockBuilder.build_date.return_value = testtuple[1] result = _parse_calendar_day(testtuple[0], mockBuilder) self.assertEqual(result, testtuple[1]) mockBuilder.build_date.assert_called_once_with(**testtuple[1])
def test_parse_calendar_day(self): testtuples = ( ("1981-04-05", {"YYYY": "1981", "MM": "04", "DD": "05"}), ("19810405", {"YYYY": "1981", "MM": "04", "DD": "05"}), ) for testtuple in testtuples: mockBuilder = mock.Mock() mockBuilder.build_date.return_value = testtuple[1] result = _parse_calendar_day(testtuple[0], mockBuilder) self.assertEqual(result, testtuple[1]) mockBuilder.build_date.assert_called_once_with(**testtuple[1])
def test_parse_calendar_day(self): date = _parse_calendar_day('1981-04-05') self.assertEqual(date, datetime.date(1981, 4, 5)) date = _parse_calendar_day('19810405') self.assertEqual(date, datetime.date(1981, 4, 5))