Skip to content
Snippets Groups Projects
Commit a866396e authored by anonymous's avatar anonymous
Browse files

add tests

parent 96b7fe2b
Branches
Tags
No related merge requests found
...@@ -50,6 +50,7 @@ class TestHarvest: ...@@ -50,6 +50,7 @@ class TestHarvest:
return self.app return self.app
def _load_rdf_catalog(self): def _load_rdf_catalog(self):
with open('ckanext/odsh/tests/rdf_catalog.xml', 'r') as rdffile: # with open('ckanext/odsh/tests/rdf_catalog.xml', 'r') as rdffile:
with open('ckanext/odsh/tests/rdf_catalog_empty.xml', 'r') as rdffile:
data = rdffile.read() data = rdffile.read()
return data return data
...@@ -18,21 +18,6 @@ class TestSelenium: ...@@ -18,21 +18,6 @@ class TestSelenium:
TestSelenium.app = SeleniumCkanApp() TestSelenium.app = SeleniumCkanApp()
# TestSelenium.app.login() # TestSelenium.app.login()
def notest_edit_paths(self):
paths = ['/organization/edit/' + test_org,
'/dataset/edit/testtesttest',
'/dataset/testtesttest/resource_edit/afaec407-d033-439d-a699-fe9279b20e6b',
'/dataset/new_resource/testtesttest',
'/dataset/new?group=',
'/harvest',
'/harvest/test2',
'/harvest/admin/test2'
]
for path in paths:
TestSelenium.app.got_to_url(path)
cont = TestSelenium.app.get_slave_flag()
assert cont == u'0'
def test_login(self): def test_login(self):
TestSelenium.app.login() TestSelenium.app.login()
assert '/dataset' in TestSelenium.app.currentUrl() assert '/dataset' in TestSelenium.app.currentUrl()
...@@ -64,3 +49,19 @@ class TestSelenium: ...@@ -64,3 +49,19 @@ class TestSelenium:
TestSelenium.app.findElementById('form-submit-button').click() TestSelenium.app.findElementById('form-submit-button').click()
assert 'dataset/'+title in TestSelenium.app.currentUrl() assert 'dataset/'+title in TestSelenium.app.currentUrl()
@depends(after=test_create_dataset)
def test_edit_paths(self):
paths = ['/organization/edit/' + test_org,
'/dataset/edit/testtesttest',
'/dataset/testtesttest/resource_edit/afaec407-d033-439d-a699-fe9279b20e6b',
'/dataset/new_resource/testtesttest',
'/dataset/new?group=',
'/harvest',
'/harvest/test2',
'/harvest/admin/test2'
]
for path in paths:
TestSelenium.app.got_to_url(path)
cont = TestSelenium.app.get_slave_flag()
assert cont == u'0'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment