Skip to content

Commit

Permalink
Ensure revision tests don't fail on new downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbjoernl committed Aug 9, 2024
1 parent 81a0914 commit 2567562
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions tests/test_AERONETSDATimeSeriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_dl_data_tared(self):
self.assertEqual(count, 421984)
self.assertEqual(len(ts.stations()), 94)
self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 230726120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 230726120000)

def test_dl_data_unzipped(self):
if not self.external_resource_available(TEST_URL):
Expand All @@ -66,7 +66,7 @@ def test_dl_data_unzipped(self):
self.assertEqual(count, 79944)
self.assertEqual(len(ts.stations()), 4)
self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 220622120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 220622120000)

def test_dl_data_zipped(self):
if not self.external_resource_available(TEST_ZIP_URL):
Expand All @@ -85,7 +85,7 @@ def test_dl_data_zipped(self):
self.assertEqual(len(ts.stations()), 4)

self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 220622120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 220622120000)

def test_aeronet_data_zipped(self):
if not os.path.exists("/lustre"):
Expand All @@ -107,7 +107,7 @@ def test_aeronet_data_zipped(self):
self.assertGreaterEqual(len(ts.stations()), 4)

self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 240523120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 240523120000)

def test_init(self):
engine = pyaro.list_timeseries_engines()["aeronetsdareader"]
Expand Down
6 changes: 3 additions & 3 deletions tests/test_AERONETTimeSeriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_dl_data_unzipped(self):
count += len(ts.data(var))
self.assertEqual(count, 49965)
self.assertEqual(len(ts.stations()), 4)
self.assertGreaterEqual(ts.metadata()["revision"], 220622120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 220622120000)

def test_dl_data_zipped(self):
if not self.external_resource_available(TEST_ZIP_URL):
Expand All @@ -61,7 +61,7 @@ def test_dl_data_zipped(self):
count += len(ts.data(var))
self.assertEqual(count, 49965)
self.assertEqual(len(ts.stations()), 4)
self.assertGreaterEqual(ts.metadata()["revision"], 220622120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 220622120000)

def test_aeronet_data_zipped(self):
if not os.path.exists("/lustre"):
Expand All @@ -81,7 +81,7 @@ def test_aeronet_data_zipped(self):
count += len(ts.data(var))
self.assertGreaterEqual(count, 49965)
self.assertGreaterEqual(len(ts.stations()), 4)
self.assertGreaterEqual(ts.metadata()["revision"], 240523120000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 240523120000)

def test_init(self):
engine = pyaro.list_timeseries_engines()["aeronetsunreader"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_HARPReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_1read(self):
self.assertGreaterEqual(len(ts.stations()), 1)

self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 240326150136)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 240326150136)

def test_2open_directory(self):
if os.path.exists(self.testdata_dir):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_NILUPMFAbsorptionReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_1open_single_file(self):
self.assertEqual(len(ts.stations()), 1)

self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 180301000000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 180301000000)

def test_2open_directory(self):
with pyaro.open_timeseries(self.engine, self.testdata_dir, filters=[]) as ts:
Expand All @@ -41,7 +41,7 @@ def test_2open_directory(self):
assert var in self.test_vars

self.assertIn("revision", ts.metadata())
self.assertGreaterEqual(ts.metadata()["revision"], 180301000000)
self.assertGreaterEqual(int(ts.metadata()["revision"]), 180301000000)


if __name__ == "__main__":
Expand Down

0 comments on commit 2567562

Please sign in to comment.