Skip to content

Commit a81244b

Browse files
committed
Rename CVE endpoints for better flexibility
1 parent 5573f80 commit a81244b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tests/publisher/cve/test_has_cve_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TestModelServiceEndpoints(TestEndpoints):
4141
def test_has_cves_for_canonical_user(self, mock_get_snap_info, mock_get):
4242
self._set_user_is_canonical(True)
4343

44-
response = self.client.get("api/snaps/cve/test")
44+
response = self.client.get("api/test/cves/available")
4545
data = response.json
4646

4747
self.assertEqual(response.status_code, 200)
@@ -58,14 +58,14 @@ def test_has_cves_for_canonical_user(self, mock_get_snap_info, mock_get):
5858
def test_has_cves_no_data(self, mock_get_snap_info, mock_get):
5959
self._set_user_is_canonical(True)
6060

61-
response = self.client.get("api/snaps/cve/test")
61+
response = self.client.get("api/test/cves/available")
6262
data = response.json
6363

6464
self.assertEqual(response.status_code, 404)
6565
self.assertEqual(data["success"], False)
6666

6767
def test_has_cves_for_non_canonical_user(self):
68-
response = self.client.get("api/snaps/cve/test")
68+
response = self.client.get("api/test/cves/available")
6969
data = response.json
7070

7171
self.assertEqual(response.status_code, 403)

webapp/publisher/snaps/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,12 @@
281281

282282
# CVE API
283283
publisher_snaps.add_url_rule(
284-
"/api/snaps/cve/<snap_name>/<revision>",
284+
"/api/<snap_name>/<revision>/cves",
285285
view_func=cve_views.get_cves,
286286
)
287287

288288
publisher_snaps.add_url_rule(
289-
"/api/snaps/cve/<snap_name>",
289+
"/api/<snap_name>/cves/available",
290290
view_func=cve_views.has_cves,
291291
)
292292

0 commit comments

Comments
 (0)