|
|
@ -115,6 +115,16 @@ class TestDataset(unittest.TestCase): |
|
|
|
data = prepare_data(data) |
|
|
|
data = prepare_data(data) |
|
|
|
except ValueError: |
|
|
|
except ValueError: |
|
|
|
self.fail('Model {} raised unexpectedly'.format(model_name)) |
|
|
|
self.fail('Model {} raised unexpectedly'.format(model_name)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_prepare_data_output_fon_nan(self): |
|
|
|
|
|
|
|
data_nan = [[1523889000000, np.NaN], [1523889000001, np.NaN], [1523889000002, np.NaN]] |
|
|
|
|
|
|
|
data_none = [[1523889000000, None], [1523889000001, None], [1523889000002, None]] |
|
|
|
|
|
|
|
return_data_nan = prepare_data(data_nan) |
|
|
|
|
|
|
|
return_data_none = prepare_data(data_none) |
|
|
|
|
|
|
|
for item in return_data_nan: |
|
|
|
|
|
|
|
self.assertTrue(np.isnan(item.value)) |
|
|
|
|
|
|
|
for item in return_data_none: |
|
|
|
|
|
|
|
self.assertTrue(np.isnan(item.value)) |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if __name__ == '__main__': |
|
|
|
unittest.main() |
|
|
|
unittest.main() |
|
|
|