Skip to content

Commit

Permalink
fix test, naming conventions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-pol committed Jan 16, 2024
1 parent 4890b6f commit 4bbd644
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_update_single_value_without_replace(self, caplog, capsys):
assert capsys.readouterr().out == ''
assert len(caplog.records) == 0

def test_update_metadata_with_repetitive_field_without_replacing(self, caplog, capsys):
def test_update_metadata_with_multi_value_field_without_replacing(self, caplog, capsys):
caplog.set_level('INFO')
client = DataverseClient(config=self.cfg)
datasets = Datasets(client, dry_run=True)
Expand All @@ -55,7 +55,7 @@ def test_update_metadata_with_repetitive_field_without_replacing(self, caplog, c
assert len(caplog.records) == 1
assert (caplog.records[0].message == 'None')

def test_update_metadata_with_repetitive_compound_field(self, caplog, capsys):
def test_update_metadata_with_multi_value_compound_field(self, caplog, capsys):
caplog.set_level('INFO')
client = DataverseClient(config=self.cfg)
datasets = Datasets(client, dry_run=True)
Expand All @@ -82,7 +82,7 @@ def test_update_metadata_with_repetitive_compound_field(self, caplog, capsys):
assert len(caplog.records) == 1
assert caplog.records[0].message == 'None'

def test_update_metadata_with_single_compound_field(self, caplog, capsys):
def test_update_metadata_with_single_value_compound_field(self, caplog, capsys):
caplog.set_level('INFO')
client = DataverseClient(config=self.cfg)
datasets = Datasets(client, dry_run=True)
Expand All @@ -98,12 +98,12 @@ def test_update_metadata_with_single_compound_field(self, caplog, capsys):
# would cause an internal server error with an exception thrown by JsonParser.parseCompoundValue:
# JsonArrayImpl cannot be cast to class javax.json.JsonObject
#
# comrades-dclDryLab and comrades-dclWetLab seem to be the only single compound fields
# comrades-dclDryLab and comrades-dclWetLab seem to be the only single-value compound fields
# on dd-dtap/provisioning/files/custom-metadata-blocks/*.tsv

with pytest.raises(Exception) as e:
datasets.update_metadata(data)
assert str(e.value) == ('Single compound fields '
assert str(e.value) == ('Single-value compound fields '
"[socialScienceNotes@socialScienceNotesType] are not supported : {"
"'PID': 'doi:10.5072/FK2/8KQW3Y', "
"'socialScienceNotes@socialScienceNotesType': 'p', "
Expand Down

0 comments on commit 4bbd644

Please sign in to comment.