[LNT] r308257 - api: No need to require slash at end of route
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 19:06:39 PDT 2017
Author: matze
Date: Mon Jul 17 19:06:38 2017
New Revision: 308257
URL: http://llvm.org/viewvc/llvm-project?rev=308257&view=rev
Log:
api: No need to require slash at end of route
Modified:
lnt/trunk/lnt/server/ui/api.py
lnt/trunk/tests/server/ui/test_api.py
Modified: lnt/trunk/lnt/server/ui/api.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/api.py?rev=308257&r1=308256&r2=308257&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/api.py (original)
+++ lnt/trunk/lnt/server/ui/api.py Mon Jul 17 19:06:38 2017
@@ -389,10 +389,10 @@ def ts_path(path):
def load_api_resources(api):
- api.add_resource(Machines, ts_path("machines/"))
+ api.add_resource(Machines, ts_path("machines"), ts_path("machines/"))
api.add_resource(Machine, ts_path("machines/<machine_id>"))
api.add_resource(Runs, ts_path("runs/<int:run_id>"))
- api.add_resource(SamplesData, ts_path("samples"))
+ api.add_resource(SamplesData, ts_path("samples"), ts_path("samples/"))
api.add_resource(SampleData, ts_path("samples/<sample_id>"))
api.add_resource(Order, ts_path("orders/<int:order_id>"))
graph_url = "graph/<int:machine_id>/<int:test_id>/<int:field_index>"
Modified: lnt/trunk/tests/server/ui/test_api.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/test_api.py?rev=308257&r1=308256&r2=308257&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/test_api.py (original)
+++ lnt/trunk/tests/server/ui/test_api.py Mon Jul 17 19:06:38 2017
@@ -141,6 +141,11 @@ class JSONAPITester(unittest.TestCase):
self.assertEquals(j['machines'], machines_expected_response)
self.assertIsNone(j.get('runs'))
+ j = check_json(client, 'api/db_default/v4/nts/machines')
+ self._check_response_is_well_formed(j)
+ self.assertEquals(j['machines'], machines_expected_response)
+ self.assertIsNone(j.get('runs'))
+
# Machine + properties + run information.
j = check_json(client, 'api/db_default/v4/nts/machines/1')
self._check_response_is_well_formed(j)
More information about the llvm-commits
mailing list