def test_viewref_pickle(self): ref = ViewRef('Example.Path1 * Example.Path2') dumped = pickle.dumps(ref) ref2 = pickle.loads(dumped) self.assertEqual(ref.specification, [('Example', 'Path1'), ('Example', 'Path2')]) self.assertEqual(ref.specification, ref2.specification)
def test_resolve_setattr(self): ref = ViewRef().Example.Path1 * ViewRef().Example.Path2 overlay = ref.resolve(self.tree) self.assertEqual(len(overlay), 2)
def test_resolve_constructor(self): ref = ViewRef('Example.Path1 * Example.Path2') overlay = ref.resolve(self.tree) self.assertEqual(len(overlay), 2)