def test_offset_by_time_invalid(self): with self.assertRaises(_ud.UdunitsError) as cm: _ud.offset_by_time(self.metre, -31622400.0) ex = cm.exception
def test_offset_by_time_valid(self): time_since = _ud.offset_by_time(self.second, -31622400.0) self.assertIsNotNone(time_since)