Skip to content
Snippets Groups Projects
Commit 4277efb3 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

add failing test

parent 2e340128
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -33,6 +33,9 @@ class Test_gsdf(unittest.TestCase): ...@@ -33,6 +33,9 @@ class Test_gsdf(unittest.TestCase):
super(Test_gsdf, cls).tearDownClass() super(Test_gsdf, cls).tearDownClass()
#shutil.rmtree(tmp_path) #shutil.rmtree(tmp_path)
def test_error(self):
raise Exception()
def test_minimum_requirements (self): def test_minimum_requirements (self):
fn = tmp_path + "minimum.hdf5" fn = tmp_path + "minimum.hdf5"
f = h5py.File(fn, "w") f = h5py.File(fn, "w")
......
...@@ -14,10 +14,12 @@ import numpy as np ...@@ -14,10 +14,12 @@ import numpy as np
import datetime import datetime
from wetb.gtsdf.unix_time import to_unix, from_unix from wetb.gtsdf.unix_time import to_unix, from_unix
class TestUnixTime(unittest.TestCase): class TestUnixTime(unittest.TestCase):
def test_to_unix(self): def test_to_unix(self):
print (np.array([5]))
self.assertEqual(to_unix(datetime.datetime(2016, 2, 2, 13, 6, 25)), 1454418385) self.assertEqual(to_unix(datetime.datetime(2016, 2, 2, 13, 6, 25)), 1454418385)
self.assertEqual(to_unix([datetime.datetime(2016, 2, 2, 13, 6, 25),datetime.datetime(2016, 2, 2, 13, 6, 26)]), [1454418385,1454418386]) self.assertEqual(to_unix([datetime.datetime(2016, 2, 2, 13, 6, 25),datetime.datetime(2016, 2, 2, 13, 6, 26)]), [1454418385,1454418386])
self.assertNotEqual(to_unix(datetime.datetime(2016, 2, 2, 13, 6, 26)), 1454418385) self.assertNotEqual(to_unix(datetime.datetime(2016, 2, 2, 13, 6, 26)), 1454418385)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment