enhance singleton testing

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-07-10 17:21:38 +02:00
commit c1441fc676
4 changed files with 17 additions and 0 deletions

View file

@ -83,6 +83,13 @@ class EmulatorTestCase(test.CdistTestCase):
emu = emulator.Emulator(argv, env=self.env)
self.assertRaises(core.cdist_object.MissingObjectIdError, emu.run)
def test_no_singleton_no_requirement(self):
argv = ['__file', '/tmp/foobar']
self.env['require'] = '__test_singleton'
emu = emulator.Emulator(argv, env=self.env)
emu.run()
# If reached here, everything is fine
def test_singleton_object_requirement(self):
argv = ['__file', '/tmp/foobar']
self.env['require'] = '__issue'