Skip to content

Commit dac4b2b

Browse files
committed
fix tests for author
1 parent 5aa4bc0 commit dac4b2b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

tests/test_dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def test_dataset_instantiation(dataset_minimal_data):
1414
assert dataset.wasGeneratedBy == [] # No generatedBy provided
1515
assert dataset.wasDerivedFrom == [] # No derivedFrom provided
1616
assert len(dataset.wasAttributedTo) == 1
17-
assert isinstance(dataset.wasAttributedTo[0], IdentifierValue)
18-
assert dataset.wasAttributedTo[0].guid == dataset_minimal_data["author"]
17+
assert isinstance(dataset.wasAttributedTo[0], str)
18+
assert dataset.wasAttributedTo[0] == dataset_minimal_data["author"]
1919

2020
def test_dataset_missing_required_field(dataset_minimal_data):
2121
"""Test that a ValidationError is raised for a missing required field."""
@@ -67,8 +67,8 @@ def test_dataset_with_provenance(dataset_minimal_data):
6767
assert dataset.wasDerivedFrom[0].guid == "ark:59852/dataset-source"
6868

6969
assert len(dataset.wasAttributedTo) == 2
70-
assert all(isinstance(item, IdentifierValue) for item in dataset.wasAttributedTo)
71-
author_ids = [item.guid for item in dataset.wasAttributedTo]
70+
assert all(isinstance(item, str) for item in dataset.wasAttributedTo)
71+
author_ids = [item for item in dataset.wasAttributedTo]
7272
assert "Author 1" in author_ids
7373
assert "Author 2" in author_ids
7474

tests/test_mlmodel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def test_mlmodel_instantiation(mlmodel_minimal_data):
2222

2323
# Test PROV field auto-population
2424
assert len(mlmodel.wasAttributedTo) == 1
25-
assert isinstance(mlmodel.wasAttributedTo[0], IdentifierValue)
26-
assert mlmodel.wasAttributedTo[0].guid == mlmodel_minimal_data["author"]
25+
assert isinstance(mlmodel.wasAttributedTo[0], str)
26+
assert mlmodel.wasAttributedTo[0] == mlmodel_minimal_data["author"]
2727

2828
def test_mlmodel_missing_required_field(mlmodel_minimal_data):
2929
"""Test ValidationError for missing a required field."""
@@ -45,8 +45,8 @@ def test_mlmodel_with_multiple_authors(mlmodel_minimal_data):
4545

4646
# Test PROV:wasAttributedTo handles list of authors
4747
assert len(mlmodel.wasAttributedTo) == 2
48-
assert all(isinstance(item, IdentifierValue) for item in mlmodel.wasAttributedTo)
49-
author_ids = [item.guid for item in mlmodel.wasAttributedTo]
48+
assert all(isinstance(item, str) for item in mlmodel.wasAttributedTo)
49+
author_ids = [item for item in mlmodel.wasAttributedTo]
5050
assert "ML Author 1" in author_ids
5151
assert "ML Author 2" in author_ids
5252

0 commit comments

Comments
 (0)