Skip to content

Commit 7d6afcf

Browse files
Update test_rdm.py
1 parent d937dbd commit 7d6afcf

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tests/test_rdm.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,49 @@
55
get_metadata,
66
)
77
import json
8+
import os
89

910

1011
def test_datacite_rdm_conversion(full_datacite43_record, full_rdm_record):
11-
converted = customize_schema(full_datacite43_record, schema="43", pilot=True)
12+
converted = customize_schema(full_datacite43_record, schema="43")
1213

1314
assert converted == full_rdm_record
1415

1516

1617
def test_datacite_rdm_create_edit(full_datacite43_record):
18+
env_token = os.environ.get("CALTECHDATA_TOKEN")
1719
doi = caltechdata_write(
18-
full_datacite43_record, schema="43", pilot=True, publish=True
20+
full_datacite43_record, schema="43", production=False, publish=True, token=env_token
1921
)
2022

2123
assert doi.startswith("10.33569")
2224

2325
doi = caltechdata_write(
2426
full_datacite43_record,
2527
schema="43",
26-
pilot=True,
28+
production=False,
2729
files=["codemeta.json"],
2830
publish=True,
31+
token=env_token
2932
)
3033

3134
assert doi.startswith("10.33569")
3235

3336
# If we don't publish, don't get back a DOI
34-
idv = caltechdata_write(full_datacite43_record, schema="43", pilot=True)
37+
idv = caltechdata_write(full_datacite43_record, schema="43", production=False, token=env_token)
3538

3639
assert idv.startswith("10.33569") == False
3740

3841
full_datacite43_record["publisher"] = "Edited"
3942

4043
doi = caltechdata_edit(
41-
idv, full_datacite43_record, schema="43", pilot=True, publish=True
44+
idv, full_datacite43_record, schema="43", production=False, publish=True, token=env_token
4245
)
4346

4447
assert doi.startswith("10.33569")
4548
idv = doi.split("/")[1]
4649

47-
new_metadata = get_metadata(idv, production=False, pilot=True)
50+
new_metadata = get_metadata(idv, production=False, publish=True)
4851

4952
assert new_metadata["publisher"] == "Edited"
5053

@@ -55,14 +58,15 @@ def test_datacite_rdm_create_edit(full_datacite43_record):
5558
full_datacite43_record,
5659
files=["codemeta.json"],
5760
schema="43",
58-
pilot=True,
61+
production=False,
5962
publish=True,
63+
token=env_token
6064
)
6165

6266
assert new_doi != doi
6367

6468
idv = new_doi.split("/")[1]
6569

66-
new_metadata = get_metadata(idv, production=False, pilot=True)
70+
new_metadata = get_metadata(idv, production=False)
6771

6872
assert new_metadata["publisher"] == "Again!"

0 commit comments

Comments
 (0)