Skip to content

Commit

Permalink
Updated subfolders test (#37)
Browse files Browse the repository at this point in the history
Updated test after a new dataset added
  • Loading branch information
rosepearson authored Dec 20, 2022
1 parent a41c6d7 commit 1152fc1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/test_lidar_subfolders/test_lidar_subfolders.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class OpenTopographyTestSubfolders(unittest.TestCase):
"Chch_Selwn_2015",
"Chch_Selwn_2015/NZ_Christchurch",
"NZ20_Canterbury",
"NZ20_Cant2",
]
FILE_SIZES = {
DATASETS[0]: {f"{DATASETS[0]}_TileIndex.zip": 134113},
Expand All @@ -53,6 +54,9 @@ class OpenTopographyTestSubfolders(unittest.TestCase):
"CL2_BX24_2020_1000_2520.laz": 25891330,
f"{DATASETS[5]}_TileIndex.zip": 120930,
},
DATASETS[6]: {
f"{DATASETS[6]}_TileIndex.zip": 1133609,
},
}

@classmethod
Expand Down Expand Up @@ -145,8 +149,9 @@ def test_correct_files_downloaded(self):
if file.is_file()
]
),
f"There should be the dataset_files files in dataset {key} instead there are "
+ f"{[file for file in dataset_dir.iterdir() if file.is_file()]}",
f"There should be the dataset_files files in dataset {key} instead "
"there are "
f"{[file for file in dataset_dir.iterdir() if file.is_file()]}",
)

def test_correct_file_sizes(self):
Expand All @@ -165,9 +170,9 @@ def test_correct_file_sizes(self):
for dataset_file in dataset_files
]
),
"There is a miss-match between the size"
+ f" of the downloaded files {[file.stat().st_size for file in dataset_files]}"
+ f" and the expected sizes of {self.FILE_SIZES[key].values()}",
"There is a miss-match between the size of the downloaded"
f" files {[file.stat().st_size for file in dataset_files]}"
f" and the expected sizes of {self.FILE_SIZES[key].values()}",
)


Expand Down

0 comments on commit 1152fc1

Please sign in to comment.