From a866396ec2fe0a3040e78d7d48d46d8c07b319ed Mon Sep 17 00:00:00 2001 From: anonymous <anonymous> Date: Thu, 13 Jun 2019 10:31:08 +0200 Subject: [PATCH] add tests --- ckanext/odsh/tests/test_harvest.py | 3 ++- ckanext/odsh/tests/test_selenium.py | 31 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ckanext/odsh/tests/test_harvest.py b/ckanext/odsh/tests/test_harvest.py index 30798c64..5b6311a8 100644 --- a/ckanext/odsh/tests/test_harvest.py +++ b/ckanext/odsh/tests/test_harvest.py @@ -50,6 +50,7 @@ class TestHarvest: return self.app 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() return data diff --git a/ckanext/odsh/tests/test_selenium.py b/ckanext/odsh/tests/test_selenium.py index 189cfc01..84046eda 100644 --- a/ckanext/odsh/tests/test_selenium.py +++ b/ckanext/odsh/tests/test_selenium.py @@ -18,21 +18,6 @@ class TestSelenium: TestSelenium.app = SeleniumCkanApp() # 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): TestSelenium.app.login() assert '/dataset' in TestSelenium.app.currentUrl() @@ -64,3 +49,19 @@ class TestSelenium: TestSelenium.app.findElementById('form-submit-button').click() 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' -- GitLab