From e56dca9bf49dabd2c5a2148ce8e80d9ca4e25c48 Mon Sep 17 00:00:00 2001 From: Jordan Kiang Date: Thu, 29 Apr 2021 11:07:19 -0700 Subject: [PATCH] rm deprecated status field from Evaluation --- synapseclient/evaluation.py | 3 --- tests/integration/synapseclient/test_evaluations.py | 10 +--------- tests/unit/synapseclient/unit_test_Evaluation.py | 6 +++--- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/synapseclient/evaluation.py b/synapseclient/evaluation.py index 4e1ec331f..8038e1045 100644 --- a/synapseclient/evaluation.py +++ b/synapseclient/evaluation.py @@ -130,10 +130,7 @@ def getURI(cls, id): return '/evaluation/%s' % id def __init__(self, **kwargs): - kwargs['status'] = kwargs.get('status', 'OPEN') kwargs['contentSource'] = kwargs.get('contentSource', '') - if kwargs['status'] not in ['OPEN', 'PLANNED', 'CLOSED', 'COMPLETED']: - raise ValueError('Evaluation Status must be one of [OPEN, PLANNED, CLOSED, COMPLETED]') if not kwargs['contentSource'].startswith('syn'): # Verify that synapse Id given raise ValueError('The "contentSource" parameter must be specified as a Synapse Entity when creating an' ' Evaluation') diff --git a/tests/integration/synapseclient/test_evaluations.py b/tests/integration/synapseclient/test_evaluations.py index 95a3f12c8..a6f020cd9 100644 --- a/tests/integration/synapseclient/test_evaluations.py +++ b/tests/integration/synapseclient/test_evaluations.py @@ -15,7 +15,7 @@ def test_evaluations(syn, project, schedule_for_cleanup): # Create an Evaluation name = 'Test Evaluation %s' % str(uuid.uuid4()) ev = Evaluation(name=name, description='Evaluation for testing', - contentSource=project['id'], status='CLOSED') + contentSource=project['id']) ev = syn.store(ev) try: @@ -29,7 +29,6 @@ def test_evaluations(syn, project, schedule_for_cleanup): assert ev['id'] == evalNamed['id'] assert ev['name'] == evalNamed['name'] assert ev['ownerId'] == evalNamed['ownerId'] - assert ev['status'] == evalNamed['status'] # -- Get the Evaluation by project evalProj = syn.getEvaluationByContentSource(project) @@ -41,13 +40,6 @@ def test_evaluations(syn, project, schedule_for_cleanup): assert ev['id'] == evalProj['id'] assert ev['name'] == evalProj['name'] assert ev['ownerId'] == evalProj['ownerId'] - assert ev['status'] == evalProj['status'] - - # Update the Evaluation - ev['status'] = 'OPEN' - ev = syn.store(ev, createOrUpdate=True) - schedule_for_cleanup(ev) - assert ev.status == 'OPEN' # Add the current user as a participant myOwnerId = int(syn.getUserProfile()['ownerId']) diff --git a/tests/unit/synapseclient/unit_test_Evaluation.py b/tests/unit/synapseclient/unit_test_Evaluation.py index 63eba06cb..9d34a5a00 100644 --- a/tests/unit/synapseclient/unit_test_Evaluation.py +++ b/tests/unit/synapseclient/unit_test_Evaluation.py @@ -9,9 +9,9 @@ def test_Evaluation(): """Test the construction and accessors of Evaluation objects.""" - # Status can only be one of ['OPEN', 'PLANNED', 'CLOSED', 'COMPLETED'] - pytest.raises(ValueError, Evaluation, name='foo', description='bar', status='BAH') - pytest.raises(ValueError, Evaluation, name='foo', description='bar', status='OPEN', contentSource='a') + # contentSource must be specified and must be a synapse id + pytest.raises(ValueError, Evaluation, name='foo', description='bar') + pytest.raises(ValueError, Evaluation, name='foo', description='bar', contentSource='a') # Assert that the values are ev = Evaluation(name='foobar2', description='bar', status='OPEN', contentSource='syn1234')