Skip to content
Snippets Groups Projects
Commit e33fe81a authored by Hoa Ben The Nguyen's avatar Hoa Ben The Nguyen
Browse files

add: faster unit test and removed unused comments in code

parent b58a10a8
No related branches found
No related tags found
No related merge requests found
Showing
with 156 additions and 21 deletions
No preview for this file type
No preview for this file type
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -27,9 +27,8 @@ def test_add_new_lidar_measurement_valid_lake() -> None:
os.makedirs(dir_path)
# expectations
actual, u = add_new_lidar_measurement(lake_name, lat, lon)
actual, _ = add_new_lidar_measurement(lake_name, lat, lon)
expected = 200
print("sub", u)
# remove temporary files and directories
if os.path.exists(file_path):
os.remove(file_path)
......
No preview for this file type
No preview for this file type
......@@ -32,7 +32,7 @@ def test_new_input_invalid_lake() -> None:
def test_new_input_unvalid_cursor() -> None:
sensor_id = 1
test_lake_name = "Mjøsa"
test_lake_name = "skumsjøen"
# create a mock cursor
mock_cursor = MagicMock()
mock_cursor.execute.side_effect = \
......@@ -63,21 +63,3 @@ def test_new_input_unvalid_cursor() -> None:
status_code, _ = input_new_Lidar_data(mock_cursor, sensor_id, test_lake_name)
assert status_code == 500
'''
def test_new_input_valid_cursor() -> None:
sensor_id = 1
test_lake_name = "Mjøsa"
# create a mock cursor
mock_cursor = MagicMock()
mock_cursor.execute.side_effect = [
[('Mjøsa'),],
None,
None,
None
]
status_code, _ = input_new_Lidar_data(mock_cursor, sensor_id, test_lake_name)
assert status_code == 200
'''
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
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