def setup(self):
     self._host = config.server['host'] + ":" + config.server['port']
     self._public = config.server['public']
     self._private = config.server['private']
     self._client = imbo.Client([self._host], self._public, self._private)
     self._res_path = os.path.dirname(__file__)
     self._valid_image_path = self._res_path + '/res/imbologo.png'
Beispiel #2
0
    def test_server_urls_from_identifiers(self):
        hosts = ('imbo.local', 'imbo.local2', )
        client = imbo.Client(hosts, 'public', 'private')

        host1 = str(client.image_url('foo')).split('/')[2]

        # the default method uses the ord() value of the chars, so increase by one to get a different host
        host2 = str(client.image_url('goo')).split('/')[2]

        assert host1 != host2
        assert host1 in hosts
        assert host2 in hosts
Beispiel #3
0
 def test_server_urls_as_string(self):
     client = imbo.Client('imbo.local', 'public', 'private')
     assert client.server_urls[0] == 'http://imbo.local'
Beispiel #4
0
 def test_server_urls_port_explicit_without_protocol(self):
     client = imbo.Client(['imbo.local:8000'], 'public', 'private')
     assert client.server_urls[0] == 'http://imbo.local:8000'
Beispiel #5
0
 def test_server_urls_port_ssl(self):
     client = imbo.Client(['https://imbo.local:443'], 'public', 'private')
     assert client.server_urls[0] == 'https://imbo.local'
Beispiel #6
0
 def test_server_urls_port_normal_explicit(self):
     client = imbo.Client(['http://imbo.local:80'], 'public', 'private')
     assert client.server_urls[0] == 'http://imbo.local'
Beispiel #7
0
 def test_server_urls_http(self):
     client = imbo.Client(['http://imbo.local'], 'public', 'private')
     assert client.server_urls[0] == 'http://imbo.local'
Beispiel #8
0
 def setup(self):
     self._client = imbo.Client(['http://imbo.local'], 'public', 'private')
     self._client_with_user = imbo.Client(['http://imbo.local'], 'public', 'private', user='******')
Beispiel #9
0
 def get_imbo(request):
     return imboclient.Client((settings['imbo.host'], ), settings['imbo.public_key'], settings['imbo.private_key'])
Beispiel #10
0
 def test_server_urls_port_normal(self):
     self._client = imbo.Client(['http://imbo.local'], 'public', 'private')
     assert self._client.server_urls[0] == 'http://imbo.local'
Beispiel #11
0
 def test_server_urls_generic(self):
     self._client = imbo.Client(['imbo.local'], 'public', 'private')
     assert self._client.server_urls[0] == 'http://imbo.local'
Beispiel #12
0
 def setup(self):
     self._client = imbo.Client(['http://imbo.local'], 'public', 'private')