def test_make_public(self): # create the collection data = {'id':(None, 'testid'), 'version' : (None, '1'), 'name' : (None, 'testcollection'), 'description':(None, 'testdescription'), 'citations':(None, 'none'), 'overwrite_merge':(None, '0')} files = {'file':("./SBOLTestRunner/src/main/resources/SBOLTestSuite/SBOL2/BBa_I0462.xml", open('./SBOLTestRunner/src/main/resources/SBOLTestSuite/SBOL2/BBa_I0462.xml', 'rb'))} compare_post_request("submit", data, headers = {"Accept": "text/plain"}, files = files, test_name = "submit_test_BBa_2") # get the view compare_get_request("/user/:userId/:collectionId/:displayId/:version/makePublic", route_parameters = ["testuser", "testid", "testid_collection", "1"]) data['tabState'] = 'new' # make the collection public compare_post_request("/user/:userId/:collectionId/:displayId/:version/makePublic", route_parameters = ["testuser", "testid", "testid_collection", "1"], data = data) # try to delete the collection with self.assertRaises(requests.exceptions.HTTPError): compare_get_request("/public/:collectionId/:displayId/:version/removeCollection", route_parameters = ["testid", "testid_collection", "1"], test_name = 'remove')
def test_create_and_delete_collections(self): # create the collection data = {'id':(None, 'testid'), 'version' : (None, '1'), 'name' : (None, 'testcollection'), 'description':(None, 'testdescription'), 'citations':(None, 'none'), 'overwrite_merge':(None, '0')} files = {'file':("./SBOLTestRunner/src/main/resources/SBOLTestSuite/SBOL2/BBa_I0462.xml", open('./SBOLTestRunner/src/main/resources/SBOLTestSuite/SBOL2/BBa_I0462.xml', 'rb'))} compare_post_request("submit", data, headers = {"Accept": "text/plain"}, files = files, test_name = "submit_test_BBa") with self.assertRaises(requests.exceptions.HTTPError): compare_post_request("submit", data, headers = {"Accept": "text/plain"}, files = files, test_name = "submit_already_in_use") self.create_collection2() compare_get_request("manage", test_name = "two_submissions") compare_get_request("submit", test_name = "two_submissions") # now remove the collections compare_get_request('/user/:userId/:collectionId/:displayId/:version/removeCollection', route_parameters = ["testuser", "testid", "testid_collection", "1"]) compare_get_request('/user/:userId/:collectionId/:displayId/:version/removeCollection', route_parameters = ["testuser", "testid2", "testid2_collection", "1"], test_name = 'remove_second') compare_get_request("manage", test_name = "no_submissions")
def test_make_public(self): data = self.make_new_collection("0") # get the view compare_get_request( "/user/:userId/:collectionId/:displayId/:version/makePublic", route_parameters=[ "testuser", "testid0", "testid0_collection", "1" ]) data['tabState'] = 'new' # make the collection public compare_post_request( "/user/:userId/:collectionId/:displayId/:version/makePublic", route_parameters=[ "testuser", "testid0", "testid0_collection", "1" ], data=data) # try to delete the collection with self.assertRaises(requests.exceptions.HTTPError): compare_get_request( "/public/:collectionId/:displayId/:version/removeCollection", route_parameters=["testid0", "testid0_collection", "1"], test_name='remove')
def test_before_login(self): # test_get_main_page(self): test_print("test_get_main_page starting") compare_get_request("/") test_print("test_get_main_page completed") # test_get_login(self): test_print("test_get_login starting") compare_get_request("/login") test_print("test_get_login completed") # test_post_bad_login(self): test_print("test_post_bad_login starting") bad_login_info = {'email' : 'bademail', 'password' : 'test'} compare_post_request("/login", bad_login_info, test_name='bad_admin_login') test_print("test_post_bad_login completed") # test_no_username_login(self): test_print("test_no_username_login starting") no_email_info = {'password' : 'test'} compare_post_request("/login", no_email_info, test_name='no_email_login') test_print("test_no_username_login completed") # test_post_login_admin(self): test_print("test_post_login_admin starting") logininfo = {'email' : '*****@*****.**', 'password' : 'test'} compare_post_request("/login", logininfo) test_print("test_post_login_admin completed")
def test_get(self): test_print("test_setup_get starting") # get the setup page and test it before setting up compare_get_request("setup") test_print("test_setup_get completed")
def test_dockeruser_persist(self): # login as the user logininfo = {'email' : 'dockertestuser', 'password' : 'test'} login_with(logininfo) # test the project view compare_get_request("manage", test_name="docker") compare_get_request("/user/:userId/:collectionId/:displayId", route_parameters = ["dockertestuser","testid_sequence1","testid_sequence1_collection"], test_name="docker")
def test_dockeruser_persist(self): # login as the user logininfo = {'email': 'dockertestuser', 'password': '******'} login_with(logininfo) # test the project view compare_get_request("manage", test_name="docker") compare_get_request("/user/:userId/:collectionId/:displayId", route_parameters=[ "dockertestuser", "testid_sequence1", "testid_sequence1_collection" ], test_name="docker")
def test_collections(TestCase): test_print("test_addOwner_get starting") # compare_get_request("/public/:collectionId/:displayId/:version/addOwner", route_parameters = ["testid1","testid1_collection","1"], test_name = "test_get_add_owner_public") compare_get_request( "user/:userId/:collectionId/:displayId/:version/addOwner", route_parameters=[ "testuser", "testid2", "testid2_collection", "1" ], test_name="test_get_add_owner_private") test_print("test_addOwner_get completed") test_print("test_addOwner_post starting") data = { 'uri': 'http://localhost:7777/user/testuser/testid2/testid2_collection/1', 'user': '******' } # compare_post_request("addOwner", data, headers = {"Accept": "text/plain"},test_name = "test_addOwnerPrivate") data = { 'uri': 'http://localhost:7777/public/testid1/testid1_collection/1', 'user': '******' } # compare_post_request("addOwner", data, headers = {"Accept": "text/plain"},test_name = "test_addOwnerPublic") test_print("test_addOwner_post completed") test_print("test_addOwner_get starting") compare_get_request( "user/:userId/:collectionId/:displayId/:version/remove", route_parameters=[ "testuser", "testid2", "testid2_collection", "1" ], test_name="test_get_add_owner_private") test_print("test_addOwner_post completed") test_print("test_addOwner_get starting") # compare_get_request("user/:userId/:collectionId/:displayId/:version/replace", route_parameters = ["testuser","testid2","testid2_collection","1"], test_name = "test_get_add_owner_private") test_print("test_addOwner_post completed")
def test_post_register(self): test_print("test_post_register starting") data = { 'username': '******', 'name': 'ronald', 'affiliation': 'synbiohubtester', 'email': '*****@*****.**', 'password1': 'test1', 'password2': 'test1' } compare_post_request("register", data, headers={"Accept": "text/plain"}, test_name="register1") logininfo = {'email': '*****@*****.**', 'password': '******'} login_with(logininfo) compare_get_request("/profile") data = { 'name': 'ronnie', 'affiliation': 'notcovid', 'email': '*****@*****.**', 'password1': 'test', 'password2': 'test' } compare_post_request("profile", data, headers={"Accept": "text/plain"}, test_name="profile2") compare_get_request("/logout") test_print("test_post_register completed") test_print("test_post_login_token starting") logininfo = {'email': '*****@*****.**', 'password': '******'} login_with(logininfo) test_print("test_post_login_token completed")
def test_public_persist(self): # login as the user logininfo = {'email' : 'dockertestuser', 'password' : 'test'} login_with(logininfo) # test public ones while signed in as user # also wait 2 seconds for things to load compare_get_request("public/:collectionId/:displayId", route_parameters = ["testid", "testid_collection"], test_name = "docker_public", re_render_time = 2000) compare_get_request("public/:collectionId/:displayId(*)/:version/full", route_parameters = ["testid", "testid_collection", "1"]) # test the component page compare_get_request("public/:collectionId/:displayId", route_parameters = ["testid", "BBa_I0462"], test_name="bbapublic")
def test_public_persist(self): # login as the user logininfo = {'email': 'dockertestuser', 'password': '******'} login_with(logininfo) # test public ones while signed in as user # also wait 2 seconds for things to load compare_get_request("public/:collectionId/:displayId", route_parameters=["testid0", "testid0_collection"], test_name="docker_public", re_render_time=2000) compare_get_request( "public/:collectionId/:displayId(*)/:version/full", route_parameters=["testid0", "testid0_collection", "1"]) # test the component page compare_get_request("public/:collectionId/:displayId", route_parameters=["testid0", "BBa_I0462"], test_name="bbapublic")
def test_get_register(self): compare_get_request('/register')
def test_get_submit_submissions_empty(self): compare_get_request("submit") compare_get_request("manage")
def test_get_login(self): compare_get_request("/login")
def test_get_main_page(self): compare_get_request("/")
def test_admin_graphs(self): compare_get_request("/admin/graphs")
def test_admin_mail(self): compare_get_request("/admin/mail")
def test_admin_status(self): compare_get_request("/admin")
def test_admin_newUser(self): compare_get_request("/admin/newUser")
def test_admin_registries(self): compare_get_request("admin/registries")
def test_admin_persist(self): logininfo = {'email' : '*****@*****.**', 'password' : 'test'} login_with(logininfo) compare_get_request("manage", test_name="docker_admin")
def test_main_page(self): headers = {'Accept':'text/plain'} compare_get_request("/", test_name = "after_admin_login", headers = headers)
def test_logout(self): compare_get_request("/logout")
def test_admin_users(self): compare_get_request("/admin/users")
def test_get(self): # get the setup page and test it before setting up compare_get_request("setup")
def test_admin_plugins(self): compare_get_request("/admin/plugins")
def test_createCollection(self): compare_get_request("/createCollection")
def test_admin_remotes(self): compare_get_request("/admin/remotes")
def test_admin_theme(self): compare_get_request("/admin/theme")
def test_public_collection_collectionid_displayId_verion_addOwner(self): compare_get_request( "public/:collectionId/:displayId/:version/addOwner", route_parameters=["testid0", "BBa_I0462", "1"])
def test_admin_sparql(self): compare_get_request("/admin/sparql", headers={"Accept": "text/html"})
def test_advancedSearch(self): compare_get_request("/advancedSearch")
def test_admin_explorer(self): compare_get_request("/admin/explorer")
def test_public_collection_collectionid_displayid_version_uses(self): compare_get_request("/public/:collectionId/:displayId/:version/uses", route_parameters=["testid0", "BBa_I0462", "1"])
def test_public_collection_collectionid_displayid_version_metadata(self): compare_get_request( "/public/:collectionId/:displayId/:version/visualization", route_parameters=["testid0", "BBa_I0462", "1"])