コード例 #1
0
    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')
コード例 #2
0
ファイル: test_submit.py プロジェクト: ICO2S/synbiohub
    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")
コード例 #3
0
ファイル: test_submit.py プロジェクト: radmen/synbiohub
    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")
コード例 #4
0
    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')
コード例 #5
0
    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")
コード例 #6
0
    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")
コード例 #7
0
ファイル: docker_test.py プロジェクト: ICO2S/synbiohub
    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")
コード例 #8
0
    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")
コード例 #9
0
ファイル: test_collection.py プロジェクト: Bijikyu/synbiohub
    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")
コード例 #10
0
    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")
コード例 #11
0
ファイル: docker_test.py プロジェクト: ICO2S/synbiohub
    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")
コード例 #12
0
    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")
コード例 #13
0
ファイル: docker_test_setup.py プロジェクト: ICO2S/synbiohub
 def test_get_register(self):
     compare_get_request('/register')
コード例 #14
0
ファイル: test_submit.py プロジェクト: radmen/synbiohub
 def test_get_submit_submissions_empty(self):
     compare_get_request("submit")
     compare_get_request("manage")
コード例 #15
0
 def test_get_login(self):
     compare_get_request("/login")
コード例 #16
0
 def test_get_main_page(self):
     compare_get_request("/")
コード例 #17
0
 def test_admin_graphs(self):
     compare_get_request("/admin/graphs")
コード例 #18
0
 def test_admin_mail(self):
     compare_get_request("/admin/mail")
コード例 #19
0
 def test_admin_status(self):
     compare_get_request("/admin")
コード例 #20
0
 def test_admin_newUser(self):
     compare_get_request("/admin/newUser")
コード例 #21
0
 def test_admin_registries(self):
     compare_get_request("admin/registries")
コード例 #22
0
ファイル: docker_test.py プロジェクト: ICO2S/synbiohub
 def test_admin_persist(self):
     logininfo = {'email' : '*****@*****.**',
                  'password' : 'test'}
     login_with(logininfo)
     compare_get_request("manage", test_name="docker_admin")
コード例 #23
0
ファイル: test_submit.py プロジェクト: ICO2S/synbiohub
 def test_main_page(self):
     headers = {'Accept':'text/plain'}
     compare_get_request("/", test_name = "after_admin_login", headers = headers)
コード例 #24
0
ファイル: test_submit.py プロジェクト: radmen/synbiohub
 def test_main_page(self):
     headers = {'Accept':'text/plain'}
     compare_get_request("/", test_name = "after_admin_login", headers = headers)
コード例 #25
0
 def test_logout(self):
     compare_get_request("/logout")
コード例 #26
0
 def test_admin_users(self):
     compare_get_request("/admin/users")
コード例 #27
0
ファイル: first_time_setup.py プロジェクト: ICO2S/synbiohub
 def test_get(self):
     # get the setup page and test it before setting up
     compare_get_request("setup")
コード例 #28
0
 def test_admin_plugins(self):
     compare_get_request("/admin/plugins")
コード例 #29
0
 def test_createCollection(self):
     compare_get_request("/createCollection")
コード例 #30
0
 def test_admin_remotes(self):
     compare_get_request("/admin/remotes")
コード例 #31
0
ファイル: test_submit.py プロジェクト: ICO2S/synbiohub
 def test_get_submit_submissions_empty(self):
     compare_get_request("submit")
     compare_get_request("manage")
コード例 #32
0
 def test_admin_theme(self):
     compare_get_request("/admin/theme")
コード例 #33
0
 def test_public_collection_collectionid_displayId_verion_addOwner(self):
     compare_get_request(
         "public/:collectionId/:displayId/:version/addOwner",
         route_parameters=["testid0", "BBa_I0462", "1"])
コード例 #34
0
 def test_admin_sparql(self):
     compare_get_request("/admin/sparql", headers={"Accept": "text/html"})
コード例 #35
0
 def test_advancedSearch(self):
     compare_get_request("/advancedSearch")
コード例 #36
0
 def test_admin_explorer(self):
     compare_get_request("/admin/explorer")
コード例 #37
0
 def test_public_collection_collectionid_displayid_version_uses(self):
     compare_get_request("/public/:collectionId/:displayId/:version/uses",
                         route_parameters=["testid0", "BBa_I0462", "1"])
コード例 #38
0
ファイル: first_time_setup.py プロジェクト: radmen/synbiohub
 def test_get(self):
     # get the setup page and test it before setting up
     compare_get_request("setup")
コード例 #39
0
 def test_public_collection_collectionid_displayid_version_metadata(self):
     compare_get_request(
         "/public/:collectionId/:displayId/:version/visualization",
         route_parameters=["testid0", "BBa_I0462", "1"])