Skip to content

Commit

Permalink
Add new lines around assert lines
Browse files Browse the repository at this point in the history
  • Loading branch information
gounux committed Jan 4, 2025
1 parent beef483 commit cf15480
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docker-app/qfieldcloud/core/tests/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def test_bad_layer_handler_values_for_process_projectfile_job(self):
response = self.upload_file(
self.p1, "simple_bumblebees_wrong_localized.qgs", "project.qgs"
)

self.assertEqual(response.status_code, status.HTTP_201_CREATED)

wait_for_project_ok_status(self.p1)
Expand All @@ -81,6 +82,7 @@ def test_bad_layer_handler_values_for_process_projectfile_job(self):
self.assertIsNotNone(processprojectfile_job.feedback)

self.p1.refresh_from_db()

self.assertIsNotNone(self.p1.project_details)

# extract layer data from job
Expand All @@ -90,13 +92,15 @@ def test_bad_layer_handler_values_for_process_projectfile_job(self):

# "valid" localized layer -> QFC considers it as invalid
valid_localized_layer = processfile_layers["valid_localized_point_layer_id"]

self.assertFalse(valid_localized_layer["is_valid"])
self.assertTrue(valid_localized_layer["is_localized"])

# invalid localized layer
invalid_localized_layer = processfile_layers[
"invalid_localized_polygon_layer_id"
]

self.assertFalse(invalid_localized_layer["is_valid"])
self.assertTrue(invalid_localized_layer["is_localized"])
self.assertEquals(
Expand All @@ -105,6 +109,7 @@ def test_bad_layer_handler_values_for_process_projectfile_job(self):

# invalid layer (datasource does not exist)
invalid_layer = processfile_layers["invalid_point_layer_id"]

self.assertFalse(invalid_layer["is_valid"])
self.assertFalse(invalid_layer["is_localized"])
self.assertEquals(invalid_layer["error_code"], "invalid_dataprovider")
Expand All @@ -115,10 +120,13 @@ def test_bad_layer_handler_values_for_package_job(self):

# Push the QGIS project and datasource GPKG files
response = self.upload_file(self.p1, "bumblebees.gpkg", "bumblebees.gpkg")

self.assertEqual(response.status_code, status.HTTP_201_CREATED)

response = self.upload_file(
self.p1, "simple_bumblebees_wrong_localized.qgs", "project.qgs"
)

self.assertEqual(response.status_code, status.HTTP_201_CREATED)

# Create Package job and wait for it to finish
Expand All @@ -134,10 +142,13 @@ def test_bad_layer_handler_values_for_package_job(self):
project=self.p1,
created_by=self.u1,
)

self.assertEqual(package_job.status, Job.Status.PENDING)

wait_for_project_ok_status(self.p1)

package_job.refresh_from_db()

self.assertEqual(package_job.status, Job.Status.FINISHED)
self.assertIsNotNone(package_job.feedback)

Expand All @@ -151,11 +162,13 @@ def test_bad_layer_handler_values_for_package_job(self):

# "valid" localized layer -> QFC considers it as invalid (QGIS)
valid_localized_qgis_layer = qgis_layers["valid_localized_point_layer_id"]

self.assertFalse(valid_localized_qgis_layer["is_valid"])
self.assertTrue(valid_localized_qgis_layer["is_localized"])

# invalid localized layer (QGIS)
invalid_localized_qgis_layer = qgis_layers["invalid_localized_polygon_layer_id"]

self.assertFalse(invalid_localized_qgis_layer["is_valid"])
self.assertTrue(invalid_localized_qgis_layer["is_localized"])
self.assertEquals(
Expand All @@ -164,13 +177,15 @@ def test_bad_layer_handler_values_for_package_job(self):

# "valid" localized layer -> QFC considers it as invalid (QField)
valid_localized_qfield_layer = qfield_layers["valid_localized_point_layer_id"]

self.assertFalse(valid_localized_qfield_layer["is_valid"])
self.assertTrue(valid_localized_qfield_layer["is_localized"])

# invalid localized layer (QField)
invalid_localized_qfield_layer = qfield_layers[
"invalid_localized_polygon_layer_id"
]

self.assertFalse(invalid_localized_qfield_layer["is_valid"])
self.assertTrue(invalid_localized_qfield_layer["is_localized"])
self.assertEquals(
Expand All @@ -182,6 +197,7 @@ def test_bad_layer_handler_values_for_package_job(self):

# invalid layer (datasource does not exist) (QGIS)
invalid_layer = qgis_layers["invalid_point_layer_id"]

self.assertFalse(invalid_layer["is_valid"])
self.assertFalse(invalid_layer["is_localized"])
self.assertEquals(invalid_layer["error_code"], "invalid_dataprovider")

0 comments on commit cf15480

Please sign in to comment.