[ARVADOS] updated: 2.1.0-1987-g1d7078e64

Git user git at public.arvados.org
Thu Mar 3 14:17:17 UTC 2022


Summary of changes:
 sdk/python/tests/test_vocabulary.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

       via  1d7078e6475545bd358167a354b9e12835e6d677 (commit)
      from  a617106e4baa22910292a47a1cab38b7cb7ea739 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1d7078e6475545bd358167a354b9e12835e6d677
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Mar 3 11:16:53 2022 -0300

    18574: Adds remaining invalid key/value test cases.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/sdk/python/tests/test_vocabulary.py b/sdk/python/tests/test_vocabulary.py
index 1d3d7b627..aa2e739e2 100644
--- a/sdk/python/tests/test_vocabulary.py
+++ b/sdk/python/tests/test_vocabulary.py
@@ -173,6 +173,10 @@ class VocabularyTest(unittest.TestCase):
             strict_voc.convert_to_identifiers({'foo': 'bar'})
 
     def test_convert_to_identifiers_invalid_key(self):
+        with self.assertRaises(vocabulary.VocabularyKeyError):
+            self.voc.convert_to_identifiers({42: 'bar'})
+        with self.assertRaises(vocabulary.VocabularyKeyError):
+            self.voc.convert_to_identifiers({None: 'bar'})
         with self.assertRaises(vocabulary.VocabularyKeyError):
             self.voc.convert_to_identifiers({('f', 'o', 'o'): 'bar'})
 
@@ -188,6 +192,16 @@ class VocabularyTest(unittest.TestCase):
     def test_convert_to_identifiers_invalid_value(self):
         with self.assertRaises(vocabulary.VocabularyValueError):
             self.voc.convert_to_identifiers({'Animal': 42})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_identifiers({'Animal': None})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_identifiers({'Animal': {'hello': 'world'}})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_identifiers({'Animal': [42]})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_identifiers({'Animal': [None]})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_identifiers({'Animal': [{'hello': 'world'}]})
 
     def test_convert_to_identifiers_unknown_value_list(self):
         # Non-strict key
@@ -256,6 +270,10 @@ class VocabularyTest(unittest.TestCase):
     def test_convert_to_labels_invalid_key(self):
         with self.assertRaises(vocabulary.VocabularyKeyError):
             self.voc.convert_to_labels({42: 'bar'})
+        with self.assertRaises(vocabulary.VocabularyKeyError):
+            self.voc.convert_to_labels({None: 'bar'})
+        with self.assertRaises(vocabulary.VocabularyKeyError):
+            self.voc.convert_to_labels({('f', 'o', 'o'): 'bar'})
 
     def test_convert_to_labels_unknown_value(self):
         # Non-strict key
@@ -269,6 +287,18 @@ class VocabularyTest(unittest.TestCase):
     def test_convert_to_labels_invalid_value(self):
         with self.assertRaises(vocabulary.VocabularyValueError):
             self.voc.convert_to_labels({'IDTAGIMPORTANCES': {'high': True}})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_labels({'IDTAGIMPORTANCES': None})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_labels({'IDTAGIMPORTANCES': 42})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_labels({'IDTAGIMPORTANCES': False})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_labels({'IDTAGIMPORTANCES': [42]})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_labels({'IDTAGIMPORTANCES': [None]})
+        with self.assertRaises(vocabulary.VocabularyValueError):
+            self.voc.convert_to_labels({'IDTAGIMPORTANCES': [{'high': True}]})
 
     def test_convert_to_labels_unknown_value_list(self):
         # Non-strict key

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list