Beispiel #1
0
    def test_unit_conversion(self):
        u = TimeSeriesProp('u', 'm/s', [datetime.datetime.now()], [
            5,
        ])

        t = u.in_units('km/hr')

        assert t.data is not u.data
        assert round(t.data[0], 2) == 18.0

        with pytest.raises(unit_conversion.NotSupportedUnitError):
            # mismatched data and dates length
            t = u.in_units('nm/hr')