예제 #1
0
 def test_create(self):
     args = self.store.args
     obj = create(Connection, **args)
     assert isinstance(obj, Connection)
     assert_raises(Error, create, Connection)
     for key in args:
         os.environ['RHEV_%s' % key.upper()] = args[key]
     obj = create(Connection)
     assert isinstance(obj, Connection)
     obj = create(schema.VM)
     assert isinstance(obj, schema.VM)
     obj = create(Error, 'error')
     assert isinstance(obj, Error)
     obj = create(list)
     assert isinstance(obj, list)
예제 #2
0
 def test_create(self):
     error = create(Error, 'foo')
     assert isinstance(error, Error)
     assert str(error) == 'foo'