Пример #1
0
 def testGetQueryParamsNamesWorksCorrectly(self):
     m = api_call_router.RouterMethodMetadata("SomeMethod",
                                              http_methods=[
                                                  ("GET",
                                                   "/a/<foo>/<bar:zoo>", {})
                                              ])
     self.assertEqual(m.GetQueryParamsNames(), ["foo", "zoo"])
Пример #2
0
 def testGetQueryParamsNamesReturnsMandaotryParamsCorrectly(self):
     m = api_call_router.RouterMethodMetadata("SomeMethod",
                                              http_methods=[
                                                  ("GET",
                                                   "/a/<arg>/<bar:zoo>", {})
                                              ])
     self.assertEqual(m.GetQueryParamsNames(), ["arg", "zoo"])
Пример #3
0
 def testGetQueryParamsNamesReturnsEmptyListOnEmptyMetadata(self):
   m = api_call_router.RouterMethodMetadata("SomeMethod")
   self.assertEqual(m.GetQueryParamsNames(), [])
Пример #4
0
 def testGetQueryParamsNamesReturnsOptionalParamsForGET(self):
     m = api_call_router.RouterMethodMetadata(
         "SomeMethod",
         args_type=ApiSingleStringArgument,
         http_methods=[("GET", "/a/<foo>/<bar:zoo>", {})])
     self.assertEqual(m.GetQueryParamsNames(), ["foo", "zoo", "arg"])