From 2a5465c03cac30523f8fa5159e738e655f8ebe66 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 18 Oct 2011 14:48:06 +0200 Subject: [PATCH] test that emulator fails if requirement has illegal object_id Signed-off-by: Steven Armstrong --- lib/cdist/test/emulator/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/cdist/test/emulator/__init__.py b/lib/cdist/test/emulator/__init__.py index 66e7918a..ccdda265 100644 --- a/lib/cdist/test/emulator/__init__.py +++ b/lib/cdist/test/emulator/__init__.py @@ -73,3 +73,10 @@ class EmulatorTestCase(unittest.TestCase): os.environ['require'] = '__does-not-exist/some-id' emu = emulator.Emulator(argv) 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)