Skip to content

Commit

Permalink
tests...
Browse files Browse the repository at this point in the history
  • Loading branch information
kampfschlaefer committed May 12, 2015
1 parent d78a6d8 commit 46d5bfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/test_element.py
Expand Up @@ -28,9 +28,9 @@ def test_get_dynamic_url(resource):
class DynamicURLElement(element.Element):
id = '23'

with pytest.raises(AssertionError) as excinfo:
with pytest.raises(AttributeError) as excinfo:
DynamicURLElement(resource, {}).get_url()
assert excinfo.value.msg == 'You must define an id_attribute attribute at MoviesResource.'
assert str(excinfo.value) == 'You must define an id_attribute attribute at MoviesResource.'
resource.id_attribute = 'id'
element_obj = DynamicURLElement(resource, {})
assert element_obj.get_url() == '/'.join([resource.get_url(), element_obj.id])
Expand Down
8 changes: 4 additions & 4 deletions tests/test_resource.py
Expand Up @@ -13,18 +13,18 @@


def test_base_url_required():
with pytest.raises(AssertionError) as excinfo:
with pytest.raises(AttributeError) as excinfo:
durga.Resource()
assert excinfo.value.msg == 'You must define a "base_url" attribute.'
assert str(excinfo.value) == 'You must define a "base_url" attribute.'


def test_path_required():
class TestResource(durga.Resource):
base_url = 'https://api.example.com'

with pytest.raises(AssertionError) as excinfo:
with pytest.raises(AttributeError) as excinfo:
TestResource()
assert excinfo.value.msg == 'You must define a "path" attribute.'
assert str(excinfo.value) == 'You must define a "path" attribute.'


def test_get_url(resource):
Expand Down

0 comments on commit 46d5bfd

Please sign in to comment.