Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
#7: Update to use theblues default url and fix lint
Browse files Browse the repository at this point in the history
* Update to use theblues default url and fix lint
* Update tests to support the url change
  • Loading branch information
mitechie authored and marcoceppi committed Mar 13, 2017
1 parent a3d71ca commit 97e3766
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions charmstore/lib.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import re
import json

from theblues import charmstore
from theblues.utils import API_URL
from .error import CharmNotFound


Expand All @@ -27,7 +27,7 @@
]

DEFAULT_TIMEOUT = 10
DEFAULT_CS_API_URL = 'https://api.jujucharms.com/v4'
DEFAULT_CS_API_URL = API_URL


class CharmStore(object):
Expand Down Expand Up @@ -121,7 +121,10 @@ def revisions(self):

def file(self, path):
if path not in self.files:
raise IOError(0, 'No such file in %s' % self.__class__.__name__.lower(), path)
raise IOError(
0,
'No such file in %s' % self.__class__.__name__.lower(),
path)

return self.theblues._get(self.theblues.file_url(self.id, path)).text

Expand Down
2 changes: 1 addition & 1 deletion tests/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_entity_default_cs_params(self, _charmstore):
charmstore.lib.Entity.from_data(CHARM.get('Meta'))
_charmstore.CharmStore.assert_called_once_with(
timeout=10.0,
url='https://api.jujucharms.com/v4')
url='https://api.jujucharms.com/charmstore/v5')

@patch.dict(charmstore.lib.os.environ, {
'CS_API_URL': 'alturl',
Expand Down

0 comments on commit 97e3766

Please sign in to comment.