Skip to content

Commit 5747399

Browse files
committed
Merge branch 'hotfix_0.3.1'
2 parents 0d7ea9f + 510d1f9 commit 5747399

7 files changed

Lines changed: 53 additions & 35 deletions

File tree

CONTRIBUTING.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ If you are new to open-source development or pyDataverse, we recommend going
1616
through the `GitHub issues <https://github.com/gdcc/pyDataverse/issues>`_,
1717
to find issues that interest you. There are a number of issues listed under
1818
`beginner <https://github.com/gdcc/pyDataverse/labels/info%3Abeginner>`_,
19-
`docs <https://github.com/gdcc/pyDataverse/labels/module%3Adocs>`_,
20-
`good first issue <https://github.com/gdcc/pyDataverse/labels/info%3Agood%20first%20issue>`_
19+
`docs <https://github.com/gdcc/pyDataverse/labels/pkg%3Adocs>`_
2120
and `unassigned issues <https://github.com/gdcc/pyDataverse/issues?q=is%3Aopen++no%3Aassignee+>`_.
2221
where you could start.
2322
Once you've found an interesting issue, you can return here to
@@ -248,7 +247,7 @@ doesn’t make sense to you, updating the relevant section after you figure
248247
it out is a great way to ensure it will help the next person.
249248

250249
To find ways to contribute to the documentation, start looking the
251-
`docs issues <https://github.com/gdcc/pyDataverse/labels/module%3Adocs>`_.
250+
`docs issues <https://github.com/gdcc/pyDataverse/labels/pkg%3Adocs>`_.
252251

253252

254253
.. _contributing_documentation_about:
@@ -475,7 +474,7 @@ Like many packages, pyDataverse uses `pytest <https://docs.pytest.org/>`_ and
475474
`tox <https://tox.readthedocs.io/>`_ as test frameworks.
476475

477476
To find open tasks around tests, look at open
478-
`test issues <https://github.com/gdcc/pyDataverse/labels/module%3Atests>`_.
477+
`testing issues <https://github.com/gdcc/pyDataverse/labels/pkg%3Atesting>`_.
479478

480479
**Writing tests**
481480

HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
.. _history:
22

33

4+
0.3.1 - (2021-04-06)
5+
----------------------------------------------------------
6+
7+
`Release <https://github.com/gdcc/pyDataverse/releases/tag/0.3.1>`_
8+
9+
410
0.3.0 - (2021-01-26) - Ruth Wodak
511
----------------------------------------------------------
612

src/pyDataverse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
__email__ = "stefan.kasberger@univie.ac.at"
1515
__copyright__ = "Copyright (c) 2019 Stefan Kasberger"
1616
__license__ = "MIT License"
17-
__version__ = "0.3.0"
17+
__version__ = "0.3.1"
1818
__url__ = "https://github.com/GDCC/pyDataverse"
1919
__download_url__ = "https://pypi.python.org/pypi/pyDataverse"
2020
__description__ = "A Python module for Dataverse."

src/pyDataverse/models.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,11 @@ class Dataset(DVObject):
402402
],
403403
"software": ["softwareName", "softwareVersion"],
404404
"timePeriodCovered": ["timePeriodCoveredStart", "timePeriodCoveredEnd"],
405-
"topicClassification": ["topicClassValue", "topicClassVocab"],
405+
"topicClassification": [
406+
"topicClassValue",
407+
"topicClassVocab",
408+
"topicClassVocabURI",
409+
],
406410
}
407411
__attr_import_dv_up_geospatial_fields_values = ["geographicUnit"]
408412
__attr_import_dv_up_geospatial_fields_arrays = {

tests/api/test_api.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def test_token_missing(self):
7575
BASE_URL = os.getenv("BASE_URL")
7676
api = NativeApi(BASE_URL)
7777
resp = api.get_info_version()
78-
assert resp.json()["data"]["version"] == "4.15.1"
79-
assert resp.json()["data"]["build"] == "1377-701b56b"
78+
assert resp.json()["data"]["version"] == "4.18.1"
79+
assert resp.json()["data"]["build"] == "267-a91d370"
8080

8181
with pytest.raises(ApiAuthorizationError):
8282
ds = Dataset()
@@ -93,8 +93,8 @@ def test_token_empty_string(self):
9393
BASE_URL = os.getenv("BASE_URL")
9494
api = NativeApi(BASE_URL, "")
9595
resp = api.get_info_version()
96-
assert resp.json()["data"]["version"] == "4.15.1"
97-
assert resp.json()["data"]["build"] == "1377-701b56b"
96+
assert resp.json()["data"]["version"] == "4.18.1"
97+
assert resp.json()["data"]["build"] == "267-a91d370"
9898

9999
with pytest.raises(ApiAuthorizationError):
100100
ds = Dataset()
@@ -107,36 +107,36 @@ def test_token_empty_string(self):
107107
)
108108
api.create_dataset(":root", ds.json())
109109

110-
def test_token_no_rights(self):
111-
BASE_URL = os.getenv("BASE_URL")
112-
API_TOKEN = os.getenv("API_TOKEN_NO_RIGHTS")
113-
api = NativeApi(BASE_URL, API_TOKEN)
114-
resp = api.get_info_version()
115-
assert resp.json()["data"]["version"] == "4.15.1"
116-
assert resp.json()["data"]["build"] == "1377-701b56b"
117-
118-
with pytest.raises(ApiAuthorizationError):
119-
ds = Dataset()
120-
ds.from_json(
121-
read_file(
122-
os.path.join(
123-
BASE_DIR, "tests/data/dataset_upload_min_default.json"
124-
)
125-
)
126-
)
127-
api.create_dataset(":root", ds.json())
110+
# def test_token_no_rights(self):
111+
# BASE_URL = os.getenv("BASE_URL")
112+
# API_TOKEN = os.getenv("API_TOKEN_NO_RIGHTS")
113+
# api = NativeApi(BASE_URL, API_TOKEN)
114+
# resp = api.get_info_version()
115+
# assert resp.json()["data"]["version"] == "4.18.1"
116+
# assert resp.json()["data"]["build"] == "267-a91d370"
117+
118+
# with pytest.raises(ApiAuthorizationError):
119+
# ds = Dataset()
120+
# ds.from_json(
121+
# read_file(
122+
# os.path.join(
123+
# BASE_DIR, "tests/data/dataset_upload_min_default.json"
124+
# )
125+
# )
126+
# )
127+
# api.create_dataset(":root", ds.json())
128128

129129
def test_token_right_create_dataset_rights(self):
130130
BASE_URL = os.getenv("BASE_URL")
131131
api_su = NativeApi(BASE_URL, os.getenv("API_TOKEN_SUPERUSER"))
132132
api_nru = NativeApi(BASE_URL, os.getenv("API_TOKEN_TEST_NO_RIGHTS"))
133133

134134
resp = api_su.get_info_version()
135-
assert resp.json()["data"]["version"] == "4.15.1"
136-
assert resp.json()["data"]["build"] == "1377-701b56b"
137-
resp = api_nru.get_info_version()
138-
assert resp.json()["data"]["version"] == "4.15.1"
139-
assert resp.json()["data"]["build"] == "1377-701b56b"
135+
assert resp.json()["data"]["version"] == "4.18.1"
136+
assert resp.json()["data"]["build"] == "267-a91d370"
137+
# resp = api_nru.get_info_version()
138+
# assert resp.json()["data"]["version"] == "4.18.1"
139+
# assert resp.json()["data"]["build"] == "267-a91d370"
140140

141141
ds = Dataset()
142142
ds.from_json(
@@ -148,8 +148,8 @@ def test_token_right_create_dataset_rights(self):
148148
pid = resp.json()["data"]["persistentId"]
149149
assert resp.json()["status"] == "OK"
150150

151-
with pytest.raises(ApiAuthorizationError):
152-
resp = api_nru.get_dataset(pid)
151+
# with pytest.raises(ApiAuthorizationError):
152+
# resp = api_nru.get_dataset(pid)
153153

154154
resp = api_su.delete_dataset(pid)
155155
assert resp.json()["status"] == "OK"

tests/data/dataset_upload_full_default.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@
192192
"multiple": false,
193193
"typeClass": "primitive",
194194
"value": "Topic Classification Vocabulary"
195+
},
196+
"topicClassVocabURI": {
197+
"typeName": "topicClassVocabURI",
198+
"multiple": false,
199+
"typeClass": "primitive",
200+
"value": "https://topic.class/vocab/uri"
195201
}
196202
}
197203
]

tests/models/test_dataset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def dict_flat_set_full():
148148
{
149149
"topicClassValue": "Topic Class Value1",
150150
"topicClassVocab": "Topic Classification Vocabulary",
151+
"topicClassVocabURI": "https://topic.class/vocab/uri",
151152
}
152153
],
153154
"publication": [
@@ -395,6 +396,7 @@ def object_data_full():
395396
{
396397
"topicClassValue": "Topic Class Value1",
397398
"topicClassVocab": "Topic Classification Vocabulary",
399+
"topicClassVocabURI": "https://topic.class/vocab/uri",
398400
}
399401
],
400402
"publication": [
@@ -615,6 +617,7 @@ def dict_flat_get_full():
615617
{
616618
"topicClassValue": "Topic Class Value1",
617619
"topicClassVocab": "Topic Classification Vocabulary",
620+
"topicClassVocabURI": "https://topic.class/vocab/uri",
618621
}
619622
],
620623
"publication": [

0 commit comments

Comments
 (0)