コード例 #1
0
 def test_build_full_URL_with_unicode_chars_in_API_key(self):
     instance = OWMHTTPClient('£°test££', self.__test_cache)
     API_subset_URL = '/subset'
     params = {'a': 1}
     result = instance._build_full_URL(API_subset_URL, params)
     expected_1 = 'http://api.openweathermap.org/data/2.5/subset?a=1&APPID=%C2%A3%C2%B0test%C2%A3%C2%A3'
     expected_2 = 'http://api.openweathermap.org/data/2.5/subset?APPID=%C2%A3%C2%B0test%C2%A3%C2%A3&a=1'
     self.assertTrue(result == expected_1 or result == expected_2)
コード例 #2
0
 def test_build_full_URL(self):
     instance = OWMHTTPClient('test_API_key', self.__test_cache)
     API_subset_URL = '/subset'
     params = {'a': 1}
     result = instance._build_full_URL(API_subset_URL, params)
     expected_1 = 'http://api.openweathermap.org/data/2.5/subset?a=1&APPID=test_API_key'
     expected_2 = 'http://api.openweathermap.org/data/2.5/subset?APPID=test_API_key&a=1'
     self.assertTrue(result == expected_1 or result == expected_2)
コード例 #3
0
 def test_build_full_URL_with_unicode_chars_in_API_key(self):
     instance = OWMHTTPClient('£°test££', self.__test_cache)
     API_subset_URL = '/subset'
     params = {'a': 1}
     result = instance._build_full_URL(API_subset_URL, params)
     expected_1 = 'http://api.openweathermap.org/data/2.5/subset?a=1&APPID=%C2%A3%C2%B0test%C2%A3%C2%A3'
     expected_2 = 'http://api.openweathermap.org/data/2.5/subset?APPID=%C2%A3%C2%B0test%C2%A3%C2%A3&a=1'
     self.assertTrue(result == expected_1 or result == expected_2)
コード例 #4
0
 def test_build_full_URL(self):
     instance = OWMHTTPClient('test_API_key', self.__test_cache)
     API_subset_URL = '/subset'
     params = {'a': 1}
     result = instance._build_full_URL(API_subset_URL, params)
     expected_1 = 'http://api.openweathermap.org/data/2.5/subset?a=1&APPID=test_API_key'
     expected_2 = 'http://api.openweathermap.org/data/2.5/subset?APPID=test_API_key&a=1'
     self.assertTrue(result == expected_1 or result == expected_2)
コード例 #5
0
ファイル: test_owmhttpclient.py プロジェクト: maroffo/pyowm
 def test_build_full_URL(self):
     instance = OWMHTTPClient('test_API_key', self.__test_cache)
     API_subset_URL = 'http://test.com/api'
     params = {'a': 1}
     result = instance._build_full_URL(API_subset_URL, params)
     expected_1 = 'http://test.com/api?a=1&APPID=test_API_key'
     expected_2 = 'http://test.com/api?APPID=test_API_key&a=1'
     self.assertTrue(result == expected_1 or result == expected_2)
コード例 #6
0
 def test_build_full_URL(self):
     instance = OWMHTTPClient('test_API_key', self.__test_cache)
     API_subset_URL = 'http://test.com/api'
     params = {'a': 1}
     result = instance._build_full_URL(API_subset_URL, params)
     expected_1 = 'http://test.com/api?a=1&APPID=test_API_key'
     expected_2 = 'http://test.com/api?APPID=test_API_key&a=1'
     self.assertTrue(result == expected_1 or result == expected_2)