test that emulator fails if requirement has illegal object_id

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-18 14:48:06 +02:00
parent 030d5919e6
commit 2a5465c03c

View file

@ -73,3 +73,10 @@ class EmulatorTestCase(unittest.TestCase):
os.environ['require'] = '__does-not-exist/some-id' os.environ['require'] = '__does-not-exist/some-id'
emu = emulator.Emulator(argv) emu = emulator.Emulator(argv)
self.assertRaises(core.NoSuchTypeError, emu.run) self.assertRaises(core.NoSuchTypeError, emu.run)
def test_illegal_object_id_requirement(self):
argv = ['__file', '/tmp/foobar']
os.environ.update(self.env)
os.environ['require'] = '__file/bad/id/with/.cdist/inside'
emu = emulator.Emulator(argv)
self.assertRaises(core.IllegalObjectIdError, emu.run)