# HG changeset patch # User RĂ©mi Cardona # Date 1442572491 -7200 # Node ID 3ada28a113f841b77fa519deebf54a42372a2018 # Parent d5e3fffa9c07ba9ea67fb90f541070c8cdea7bde [py3k] dict methods no longer return indexable objects diff -r d5e3fffa9c07 -r 3ada28a113f8 test/unittest_schema.py --- a/test/unittest_schema.py Fri Sep 18 12:03:12 2015 +0200 +++ b/test/unittest_schema.py Fri Sep 18 12:34:51 2015 +0200 @@ -273,11 +273,13 @@ config = TestConfiguration('data', apphome=join(dirname(__file__), 'data_schemareader')) config.bootstrap_cubes() schema = loader.load(config) - self.assertEqual(schema['in_group'].rdefs.values()[0].permissions, + rdef = next(iter(schema['in_group'].rdefs.values())) + self.assertEqual(rdef.permissions, {'read': ('managers',), 'add': ('managers',), 'delete': ('managers',)}) - self.assertEqual(schema['cw_for_source'].rdefs.values()[0].permissions, + rdef = next(iter(schema['cw_for_source'].rdefs.values())) + self.assertEqual(rdef.permissions, {'read': ('managers', 'users'), 'add': ('managers',), 'delete': ('managers',)}) @@ -355,11 +357,11 @@ # check object/subject type self.assertEqual([('Person','Service')], - schema['produces_and_buys'].rdefs.keys()) + list(schema['produces_and_buys'].rdefs.keys())) self.assertEqual([('Person','Service')], - schema['produces_and_buys2'].rdefs.keys()) + list(schema['produces_and_buys2'].rdefs.keys())) self.assertCountEqual([('Company', 'Service'), ('Person', 'Service')], - schema['reproduce'].rdefs.keys()) + list(schema['reproduce'].rdefs.keys())) # check relation definitions are marked infered rdef = schema['produces_and_buys'].rdefs[('Person','Service')] self.assertTrue(rdef.infered)