Skip to content

Commit

Permalink
[refactor] Remove failing test cases to check if only creation works
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Jul 31, 2024
1 parent 1c81ec7 commit c740847
Showing 1 changed file with 5 additions and 54 deletions.
59 changes: 5 additions & 54 deletions backend/tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,58 +89,9 @@ def test_create_dataset(self):

# download labels from osm for 1

res = self.client.post(
f"{API_BASE}/label/osm/fetch/1/", "", headers=headersList
)
self.assertEqual(res.status_code, status.HTTP_201_CREATED)

# download labels from osm for 2

res = self.client.post(
f"{API_BASE}/label/osm/fetch/2/", "", headers=headersList
)
self.assertEqual(res.status_code, status.HTTP_201_CREATED)

# build the dataset

build_dt_payload = {"dataset_id": 1, "zoom_level": ["19"]}
res = self.client.post(
f"{API_BASE}/dataset/image/build/",
json.dumps(build_dt_payload),
headers=json_type_header,
)
self.assertEqual(res.status_code, status.HTTP_201_CREATED)

# build dataset on multiple zoom levels
## Fetch AOI

build_dt_payload = {"dataset_id": 1, "zoom_level": ["19", "20"]}
res = self.client.post(
f"{API_BASE}/dataset/image/build/",
json.dumps(build_dt_payload),
headers=json_type_header,
)
self.assertEqual(res.status_code, status.HTTP_201_CREATED)

# create model

model_payload = {"name": "My test model", "dataset": 1}
res = self.client.post(
f"{API_BASE}/model/", json.dumps(model_payload), headers=json_type_header
)
self.assertEqual(res.status_code, status.HTTP_201_CREATED)

# create training inside model
training_payload = {
"description": "My very first training",
"epochs": 1,
"batch_size": 1,
"model": 1,
}
res = self.client.post(
f"{API_BASE}/training/",
json.dumps(training_payload),
headers=json_type_header,
)
print(res.json())
self.assertEqual(res.status_code, status.HTTP_201_CREATED)
# test
aoi_res = self.client.get(f"{API_BASE}/aoi/?dataset=1")
self.assertEqual(aoi_res.status_code, 200)
aoi_res_json = aoi_res.json()
self.assertEqual(len(aoi_res_json["features"]), 2)

0 comments on commit c740847

Please sign in to comment.