(self)
| 105 | assert_identical(expected, actual) |
| 106 | |
| 107 | def test_total_seconds(self) -> None: |
| 108 | # Subtract a value in the middle of the range to ensure that some values |
| 109 | # are negative |
| 110 | delta = self.data.time - np.datetime64("2000-01-03") |
| 111 | actual = delta.dt.total_seconds() |
| 112 | expected = xr.DataArray( |
| 113 | np.arange(-48, 52, dtype=np.float64) * 3600, |
| 114 | name="total_seconds", |
| 115 | coords=[self.data.time], |
| 116 | ) |
| 117 | # This works with assert_identical when pandas is >=1.5.0. |
| 118 | assert_allclose(expected, actual) |
| 119 | |
| 120 | @pytest.mark.parametrize( |
| 121 | "field, pandas_field", |
nothing calls this directly
no test coverage detected