From 5de19cfd8e12fbd51fec9bd22f8b37c83cbbd34c Mon Sep 17 00:00:00 2001
From: vermeul <swen@ethz.ch>
Date: Tue, 2 Oct 2018 14:21:05 +0200
Subject: [PATCH] more tag tests

---
 pybis/src/python/.gitignore        |  1 +
 pybis/src/python/tests/test_tag.py | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/pybis/src/python/.gitignore b/pybis/src/python/.gitignore
index f786b8afd5a..769ea196435 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 83631c5e150..9308f3b0560 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'
+
+
-- 
GitLab