def test_datetimelike_bounded_cell(self): point = object() cell = Cell(point=object(), bound=[mock.Mock(timetuple=mock.Mock()), mock.Mock(timetuple=mock.Mock())]) with self.assertRaisesRegexp(TypeError, 'bounded region for datetime'): cell.contains_point(point)
def test_datetimelike_point(self): point = mock.Mock(timetuple=mock.Mock()) cell = Cell(point=object(), bound=[object(), object()]) with self.assertRaisesRegexp(TypeError, 'bounded region for datetime'): cell.contains_point(point)
def test_PartialDateTime_other(self): cell = Cell(datetime.datetime(2010, 3, 2)) # A few simple cases. self.assertEqual(cell, PartialDateTime(month=3)) self.assertNotEqual(cell, PartialDateTime(month=3, hour=12)) self.assertNotEqual(cell, PartialDateTime(month=4))