Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
znicholls committed Jun 15, 2021
1 parent 02ae952 commit 338bb14
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cf_units/tests/unit/unit/test_Unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ def test_gregorian_calendar_conversion_shape(self):
self.assertEqual(expected.shape, result.shape)

def test_non_gregorian_calendar_conversion_dtype(self):
data = np.arange(4, dtype=np.float32)
u1 = Unit('hours since 2000-01-01 00:00:00', calendar='360_day')
u2 = Unit('hours since 2000-01-02 00:00:00', calendar='360_day')
result = u1.convert(data, u2)
self.assertEqual(result.dtype, np.float32)
for start_dtype in [np.float32, np.float64]:
data = np.arange(4, dtype=start_dtype)
u1 = Unit('hours since 2000-01-01 00:00:00', calendar='360_day')
u2 = Unit('hours since 2000-01-02 00:00:00', calendar='360_day')
result = u1.convert(data, u2)
self.assertEqual(result.dtype, start_dtype)


class Test_convert__endianness_time(unittest.TestCase):
Expand Down

0 comments on commit 338bb14

Please sign in to comment.