def testGetQueryParamsNamesWorksCorrectly(self): m = api_call_router.RouterMethodMetadata("SomeMethod", http_methods=[ ("GET", "/a/<foo>/<bar:zoo>", {}) ]) self.assertEqual(m.GetQueryParamsNames(), ["foo", "zoo"])
def testGetQueryParamsNamesReturnsMandaotryParamsCorrectly(self): m = api_call_router.RouterMethodMetadata("SomeMethod", http_methods=[ ("GET", "/a/<arg>/<bar:zoo>", {}) ]) self.assertEqual(m.GetQueryParamsNames(), ["arg", "zoo"])
def testGetQueryParamsNamesReturnsEmptyListOnEmptyMetadata(self): m = api_call_router.RouterMethodMetadata("SomeMethod") self.assertEqual(m.GetQueryParamsNames(), [])
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"])