Skip to content

Commit

Permalink
Change cs fixture to use a http uri.
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed Mar 2, 2015
1 parent 3307bd9 commit 48b2530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
11 changes: 9 additions & 2 deletions tests/fixtures/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
DictionaryProvider
)

from skosprovider.skos import (
ConceptScheme
)

larch = {
'id': 1,
'uri': 'http://python.com/trees/larch',
Expand Down Expand Up @@ -51,12 +55,15 @@
'type': 'scopeNote', 'language': 'en',
'note': 'A division of trees.'
}
],
],
'type': 'collection',
'members': ['1', '2']
}

trees = DictionaryProvider(
{'id': 'TREES', 'default_language': 'nl'},
[larch, chestnut, species]
[larch, chestnut, species],
concept_scheme=ConceptScheme(
uri='http://python.com/trees'
)
)
2 changes: 1 addition & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class RestFunctionalTests(FunctionalTests):

def test_get_uri_cs_json(self):
res = self.testapp.get(
'/uris/urn:x-skosprovider:trees',
'/uris/http://python.com/trees',
{},
{ascii_native_('Accept'): ascii_native_('application/json')}
)
Expand Down
11 changes: 5 additions & 6 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ def test_get_unexisting_uri(self):

def test_get_uri_conceptscheme(self):
request = self._get_dummy_request()
request.matchdict = {'uri': 'urn:x-skosprovider:trees'}
request.matchdict = {'uri': 'http://python.com/trees'}
pv = self._get_provider_view(request)
u = pv.get_uri()
self.assertEqual(
{
'id': 'TREES',
'uri': 'urn:x-skosprovider:trees',
'uri': 'http://python.com/trees',
'type': 'concept_scheme'
},
u
Expand All @@ -74,7 +74,7 @@ def test_get_uri_concept(self):
'type': 'concept',
'concept_scheme': {
'id': 'TREES',
'uri': 'urn:x-skosprovider:trees',
'uri': 'http://python.com/trees',
}
},
u
Expand All @@ -92,7 +92,7 @@ def test_get_uri_collection(self):
'type': 'collection',
'concept_scheme': {
'id': 'TREES',
'uri': 'urn:x-skosprovider:trees',
'uri': 'http://python.com/trees',
}
},
u
Expand All @@ -117,7 +117,7 @@ def test_get_conceptscheme(self):
self.assertEqual(
{
'id': 'TREES',
'uri': 'urn:x-skosprovider:trees',
'uri': 'http://python.com/trees',
'label': None,
'subject': [],
'labels': [],
Expand All @@ -143,7 +143,6 @@ def test_get_concepts(self):
self.assertIsInstance(c, dict)
self.assertIn('id', c)

#@pytest.mark.xfail
def test_get_concepts_language(self):
request = self._get_dummy_request({
'language': 'en'
Expand Down

0 comments on commit 48b2530

Please sign in to comment.