diff --git a/pybis/src/python/.gitignore b/pybis/src/python/.gitignore index f786b8afd5ad428b61e131aff783e967d813e6ee..769ea19643520b2b6a3040c7329416ef1d5d135d 100644 --- a/pybis/src/python/.gitignore +++ b/pybis/src/python/.gitignore @@ -2,3 +2,4 @@ .*.sw? .ipynb_checkpoints/ *.ipynb +dist/* diff --git a/pybis/src/python/tests/test_tag.py b/pybis/src/python/tests/test_tag.py index 83631c5e150ef41ba883cfeb62a93961f5d86ce1..9308f3b0560c72a693f7e402abd2bb3fcb602455 100644 --- a/pybis/src/python/tests/test_tag.py +++ b/pybis/src/python/tests/test_tag.py @@ -25,6 +25,10 @@ def test_crud_tag(openbis_instance): tag_exists = openbis_instance.get_tag(tag.permId) assert tag_exists is not None + + tag_by_code = openbis_instance.get_tag(tag.code) + assert tag_by_code is not None + assert tag_by_code.permId == tag_exists.permId altered_description = 'altered description of tag ' + tag_name tag.description = altered_description @@ -37,3 +41,22 @@ def test_crud_tag(openbis_instance): tag_does_not_exists = openbis_instance.get_tag(tag.permId) assert "deleted tag should no longer be present" is None +def test_get_tags(openbis_instance): + tags = openbis_instance.get_tags() + assert tags is not None + assert tags.__class__.__name__ == 'Things' + assert tags.df.__class__.__name__ == 'DataFrame' + + if len(tags) > 0: + assert tags[0].__class__.__name__ == 'Tag' + + if len(tags) > 1: + tag1 = tags[0] + tag2 = tags[1] + + tag_coll = openbis_instance.get_tag([tag1.permId, tag2.permId]) + assert len(tag_coll) == 2 + assert tag_coll.__class__.__name__ == 'Things' + assert tag_coll.df.__class__.__name__ == 'DataFrame' + +