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'
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
def test_server_urls_as_string(self): client = imbo.Client('imbo.local', 'public', 'private') assert client.server_urls[0] == 'http://imbo.local'
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'
def test_server_urls_port_ssl(self): client = imbo.Client(['https://imbo.local:443'], 'public', 'private') assert client.server_urls[0] == 'https://imbo.local'
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'
def test_server_urls_http(self): client = imbo.Client(['http://imbo.local'], 'public', 'private') assert client.server_urls[0] == 'http://imbo.local'
def setup(self): self._client = imbo.Client(['http://imbo.local'], 'public', 'private') self._client_with_user = imbo.Client(['http://imbo.local'], 'public', 'private', user='******')
def get_imbo(request): return imboclient.Client((settings['imbo.host'], ), settings['imbo.public_key'], settings['imbo.private_key'])
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'
def test_server_urls_generic(self): self._client = imbo.Client(['imbo.local'], 'public', 'private') assert self._client.server_urls[0] == 'http://imbo.local'
def setup(self): self._client = imbo.Client(['http://imbo.local'], 'public', 'private')