Ejemplo n.º 1
0
 def test_check_relationships(self):
     """
     Tests that warnings are raised when
     related names are not in the ResourceMetaClass
     """
     disp = FakeDispatcher()
     rel = mock.MagicMock(relation='blah')
     klass = mock.MagicMock(relationships=[rel], links=[], __name__='blah')
     self.assertRaises(Warning, disp._check_relationships(klass))
     disp = FakeDispatcher()
     klass = mock.MagicMock(relationships=[], links=[rel], __name__='blah')
     self.assertRaises(Warning, disp._check_relationships(klass))
Ejemplo n.º 2
0
 def test_check_relationships(self):
     """
     Tests that warnings are raised when
     related names are not in the ResourceMetaClass
     """
     disp = FakeDispatcher()
     rel = mock.MagicMock(relation='blah')
     klass = mock.MagicMock(relationships=[rel], links=[], __name__='blah')
     self.assertRaises(Warning, disp._check_relationships(klass))
     disp = FakeDispatcher()
     klass = mock.MagicMock(relationships=[], links=[rel], __name__='blah')
     self.assertRaises(Warning, disp._check_relationships(klass))