From e9c44132057a5d1b806bcfff481bc6212ed6cc15 Mon Sep 17 00:00:00 2001 From: Manuel Lera-Ramirez Date: Thu, 11 Apr 2024 19:17:25 +0100 Subject: [PATCH] closes #430 --- sbol2/property.py | 2 +- test/test_participation.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sbol2/property.py b/sbol2/property.py index 1ae1efb..e5536e6 100644 --- a/sbol2/property.py +++ b/sbol2/property.py @@ -935,7 +935,7 @@ def __init__(self, property_owner, type_uri, reference_type_uri, super().__init__(property_owner, type_uri, lower_bound, upper_bound, validation_rules, initial_value) self.reference_type_uri = reference_type_uri - if self._sbol_owner is not None: + if self._sbol_owner is None: property_store = [] self._sbol_owner.properties[type_uri] = property_store diff --git a/test/test_participation.py b/test/test_participation.py index c8f8b1f..6d68715 100644 --- a/test/test_participation.py +++ b/test/test_participation.py @@ -16,6 +16,10 @@ def test_add_remove_role(self): p.removeRole(1) self.assertEqual([sbol2.SO_PROMOTER, sbol2.SO_CDS], p.roles) + def test_init_with_participant(self): + p = sbol2.Participation('p', participant='p1') + self.assertEqual('p1', p.participant) + if __name__ == '__main__': unittest.main()