Пример #1
0
    def test_search_workflows( self ):
        workflow_populator = WorkflowPopulator( self )
        workflow_id = workflow_populator.simple_workflow( "test_for_search" )
        search_response = self.__search( "select * from workflow" )
        assert self.__has_result_with_name( search_response, "test_for_search (imported from API)" ), search_response.json()

        # Deleted
        delete_url = self._api_url( "workflows/%s" % workflow_id, use_key=True )
        delete_request( delete_url )

        search_response = self.__search( "select * from workflow where not deleted" )
        assert not self.__has_result_with_name( search_response, "test_for_search (imported from API)" ), search_response.json()
Пример #2
0
    def test_search_workflows(self):
        workflow_populator = WorkflowPopulator(self.galaxy_interactor)
        workflow_id = workflow_populator.simple_workflow("test_for_search")
        search_response = self.__search("select * from workflow")
        assert self.__has_result_with_name(
            search_response,
            "test_for_search (imported from API)"), search_response.json()

        # Deleted
        delete_url = self._api_url("workflows/%s" % workflow_id, use_key=True)
        delete_request(delete_url)

        search_response = self.__search(
            "select * from workflow where deleted = False")
        assert not self.__has_result_with_name(
            search_response,
            "test_for_search (imported from API)"), search_response.json()
 def test_delete( self ):
     hda1 = self._new_dataset( self.history_id )
     self._wait_for_history( self.history_id )
     assert str( self.__show( hda1 ).json()[ "deleted" ] ).lower() == "false"
     url = self._api_url( "histories/%s/contents/%s" % ( self.history_id, hda1["id" ] ), use_key=True )
     delete_response = delete_request( url )
     assert delete_response.status_code < 300  # Something in the 200s :).
     assert str( self.__show( hda1 ).json()[ "deleted" ] ).lower() == "true"
Пример #4
0
 def test_other_cannot_delete(self):
     workflow_id = self.workflow_populator.simple_workflow(
         "test_other_delete")
     with self._different_user():
         workflow_url = self._api_url("workflows/%s" % workflow_id,
                                      use_key=True)
         delete_response = delete_request(workflow_url)
         self._assert_status_code_is(delete_response, 403)
Пример #5
0
 def test_delete(self):
     workflow_id = self.workflow_populator.simple_workflow("test_delete")
     workflow_name = "test_delete (imported from API)"
     self._assert_user_has_workflow_with_name(workflow_name)
     workflow_url = self._api_url("workflows/%s" % workflow_id, use_key=True)
     delete_response = delete_request(workflow_url)
     self._assert_status_code_is(delete_response, 200)
     # Make sure workflow is no longer in index by default.
     assert workflow_name not in self.__workflow_names()
 def test_delete(self):
     hda1 = self._new_dataset(self.history_id)
     self._wait_for_history(self.history_id)
     assert str(self.__show(hda1).json()["deleted"]).lower() == "false"
     url = self._api_url("histories/%s/contents/%s" %
                         (self.history_id, hda1["id"]),
                         use_key=True)
     delete_response = delete_request(url)
     assert delete_response.status_code < 300  # Something in the 200s :).
     assert str(self.__show(hda1).json()["deleted"]).lower() == "true"
Пример #7
0
 def test_delete(self):
     workflow_id = self.workflow_populator.simple_workflow("test_delete")
     workflow_name = "test_delete (imported from API)"
     self._assert_user_has_workflow_with_name(workflow_name)
     workflow_url = self._api_url("workflows/%s" % workflow_id,
                                  use_key=True)
     delete_response = delete_request(workflow_url)
     self._assert_status_code_is(delete_response, 200)
     # Make sure workflow is no longer in index by default.
     assert workflow_name not in self.__workflow_names()
    def test_dataset_collections(self):
        payload = self.dataset_collection_populator.create_pair_payload(
            self.history_id, type="dataset_collection")
        pre_collection_count = self.__count_contents(type="dataset_collection")
        pre_dataset_count = self.__count_contents(type="dataset")
        pre_combined_count = self.__count_contents(
            type="dataset,dataset_collection")

        dataset_collection_response = self._post(
            "histories/%s/contents" % self.history_id, payload)

        dataset_collection = self.__check_create_collection_response(
            dataset_collection_response)

        post_collection_count = self.__count_contents(
            type="dataset_collection")
        post_dataset_count = self.__count_contents(type="dataset")
        post_combined_count = self.__count_contents(
            type="dataset,dataset_collection")

        # Test filtering types with index.
        assert pre_collection_count == 0
        assert post_collection_count == 1
        assert post_combined_count == pre_dataset_count + 1
        assert post_combined_count == pre_combined_count + 1
        assert pre_dataset_count == post_dataset_count

        # Test show dataset colleciton.
        collection_url = "histories/%s/contents/dataset_collections/%s" % (
            self.history_id, dataset_collection["id"])
        show_response = self._get(collection_url)
        self._assert_status_code_is(show_response, 200)
        dataset_collection = show_response.json()
        self._assert_has_keys(dataset_collection, "url", "name", "deleted")

        assert not dataset_collection["deleted"]

        delete_response = delete_request(
            self._api_url(collection_url, use_key=True))
        self._assert_status_code_is(delete_response, 200)

        show_response = self._get(collection_url)
        dataset_collection = show_response.json()
        assert dataset_collection["deleted"]
    def test_dataset_collections( self ):
        payload = self.dataset_collection_populator.create_pair_payload(
            self.history_id,
            type="dataset_collection"
        )
        pre_collection_count = self.__count_contents( type="dataset_collection" )
        pre_dataset_count = self.__count_contents( type="dataset" )
        pre_combined_count = self.__count_contents( type="dataset,dataset_collection" )

        dataset_collection_response = self._post( "histories/%s/contents" % self.history_id, payload )

        dataset_collection = self.__check_create_collection_response( dataset_collection_response )

        post_collection_count = self.__count_contents( type="dataset_collection" )
        post_dataset_count = self.__count_contents( type="dataset" )
        post_combined_count = self.__count_contents( type="dataset,dataset_collection" )

        # Test filtering types with index.
        assert pre_collection_count == 0
        assert post_collection_count == 1
        assert post_combined_count == pre_dataset_count + 1
        assert post_combined_count == pre_combined_count + 1
        assert pre_dataset_count == post_dataset_count

        # Test show dataset colleciton.
        collection_url = "histories/%s/contents/dataset_collections/%s" % ( self.history_id, dataset_collection[ "id" ] )
        show_response = self._get( collection_url )
        self._assert_status_code_is( show_response, 200 )
        dataset_collection = show_response.json()
        self._assert_has_keys( dataset_collection, "url", "name", "deleted" )

        assert not dataset_collection[ "deleted" ]

        delete_response = delete_request( self._api_url( collection_url, use_key=True ) )
        self._assert_status_code_is( delete_response, 200 )

        show_response = self._get( collection_url )
        dataset_collection = show_response.json()
        assert dataset_collection[ "deleted" ]
Пример #10
0
 def test_other_cannot_delete(self):
     workflow_id = self.workflow_populator.simple_workflow("test_other_delete")
     with self._different_user():
         workflow_url = self._api_url("workflows/%s" % workflow_id, use_key=True)
         delete_response = delete_request(workflow_url)
         self._assert_status_code_is(delete_response, 403)
Пример #11
0
 def test_403_on_delete_unowned_page( self ):
     page_response = self._create_valid_page_as( "*****@*****.**", "otherspage" )
     delete_response = delete_request( self._api_url( "pages/%s" % page_response[ "id" ], use_key=True ) )
     self._assert_status_code_is( delete_response, 403 )
     self._assert_error_code_is( delete_response, error_codes.USER_DOES_NOT_OWN_ITEM )
Пример #12
0
 def test_404_on_delete_unknown_page( self ):
     delete_response = delete_request( self._api_url( "pages/%s" % self._random_key(), use_key=True ) )
     self._assert_status_code_is( delete_response, 404 )
     self._assert_error_code_is( delete_response, error_codes.USER_OBJECT_NOT_FOUND )
Пример #13
0
 def test_delete( self ):
     response_json = self._create_valid_page_with_slug( "testdelete" )
     delete_response = delete_request( self._api_url( "pages/%s" % response_json[ 'id' ], use_key=True ) )
     self._assert_status_code_is( delete_response, 200 )