diff nagslang/tests/test_yamlish.py @ 344:1d73867becbe

Allow tuples in dicts
author Stefano Rivera <stefano@rivera.za.net>
date Fri, 06 Sep 2013 13:38:07 +0200
parents 366b334a7018
children a106d7e1415b
line wrap: on
line diff
--- a/nagslang/tests/test_yamlish.py	Fri Sep 06 12:58:46 2013 +0200
+++ b/nagslang/tests/test_yamlish.py	Fri Sep 06 13:38:07 2013 +0200
@@ -126,6 +126,15 @@
         self.assertEqual(orig['polygons'][1][1],
                          tuple(result['polygons'][1][1]))
 
+    def test_dict_tuples(self):
+        if self.from_pyyaml:
+            raise SkipTest("Can't parse PyYAML tuples")
+        orig = {'tuple': (0, 1)}
+        text = self.dump_s(orig)
+        result = self.load_s(text)
+        self.assertEqual(orig['tuple'],
+                         tuple(result['tuple']))
+
     def test_quoted(self):
         # a literal true is True, but 'true' is a string
         self.roundtrip({'foo': 'true'})