Skip to content

Commit

Permalink
fix travis ci error gdcc#6
Browse files Browse the repository at this point in the history
  • Loading branch information
skasberger committed May 20, 2019
1 parent 99ff93a commit dc43524
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/pyDataverse/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def create_dataverse(self, identifier, metadata, auth=True,
raise DataverseNotFoundError(
'ERROR: HTTP 404 - Dataverse {0} was not found. MSG: '.format(
parent, error_msg))
elif resp.status_code != 200:
elif resp.status_code != 201:
error_msg = resp.json()['message']
raise OperationFailedError(
'ERROR: HTTP {0} - Dataverse {1} could not be created. '
Expand Down Expand Up @@ -551,11 +551,6 @@ def create_dataset(self, dataverse, metadata, auth=True):
query_str = '/dataverses/{0}/datasets'.format(dataverse)
resp = self.make_post_request(query_str, metadata, auth)

print(query_str)
print(metadata)
print(resp.status_code)
print(resp.json())

if resp.status_code == 404:
error_msg = resp.json()['message']
raise DataverseNotFoundError(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def setup_class(cls):
"""Create the api connection for later use."""
print('TEST setup_class', BASE_URL, API_TOKEN)
cls.api = Api(BASE_URL, api_token=API_TOKEN)
cls.dataverse_id = 'test-pyDataverse-3'
cls.filename_dataverse = TEST_DIR+'/data/create_dataverse_3.json'
cls.dataverse_id = 'test-pyDataverse'
cls.filename_dataverse = TEST_DIR+'/data/create_dataverse.json'
cls.filename_dataset = TEST_DIR+'/data/create_dataset.json'
assert cls.api
assert cls.api.api_token
Expand Down

0 comments on commit dc43524

Please sign in to comment.