comparison 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
comparison
equal deleted inserted replaced
343:e5f525c87eb9 344:1d73867becbe
124 self.assertEqual(orig['polygons'][1][0], 124 self.assertEqual(orig['polygons'][1][0],
125 tuple(result['polygons'][1][0])) 125 tuple(result['polygons'][1][0]))
126 self.assertEqual(orig['polygons'][1][1], 126 self.assertEqual(orig['polygons'][1][1],
127 tuple(result['polygons'][1][1])) 127 tuple(result['polygons'][1][1]))
128 128
129 def test_dict_tuples(self):
130 if self.from_pyyaml:
131 raise SkipTest("Can't parse PyYAML tuples")
132 orig = {'tuple': (0, 1)}
133 text = self.dump_s(orig)
134 result = self.load_s(text)
135 self.assertEqual(orig['tuple'],
136 tuple(result['tuple']))
137
129 def test_quoted(self): 138 def test_quoted(self):
130 # a literal true is True, but 'true' is a string 139 # a literal true is True, but 'true' is a string
131 self.roundtrip({'foo': 'true'}) 140 self.roundtrip({'foo': 'true'})
132 141
133 def test_literals(self): 142 def test_literals(self):