Example #1
0
 def testBuildUrlWithOneParam(self):
     self.assertEqual(sonar.getApiServiceUrl('http://host/api', 'service', {'key': 'value'}), 'http://host/api/service?key=value')
Example #2
0
 def testBuildUrlWithTwoParams(self):
     self.assertEqual(sonar.getApiServiceUrl('http://host/api', 'service', {'k1': 'v1', 'k2': 'v2'}), 'http://host/api/service?k2=v2&k1=v1')
Example #3
0
 def testBuildUrlWithoutParams(self):
     self.assertEqual(sonar.getApiServiceUrl('http://host/api', 'service'), 'http://host/api/service')
Example #4
0
 def testBuildUrlWithEscapedParamValue(self):
     self.assertEqual(sonar.getApiServiceUrl('http://host/api', 'service', {'key': 'hello world'}), 'http://host/api/service?key=hello%20world')