NoSuchTypeError -> InvalidTypeError

This commit is contained in:
Darko Poljak 2017-11-02 13:57:36 +01:00
commit e6c5563a16
6 changed files with 15 additions and 8 deletions

View file

@ -55,7 +55,7 @@ class TypeTestCase(test.CdistTestCase):
def test_nonexistent_type(self):
base_path = fixtures
self.assertRaises(core.NoSuchTypeError, core.CdistType, base_path,
self.assertRaises(core.InvalidTypeError, core.CdistType, base_path,
'__i-dont-exist')
def test_name(self):

View file

@ -151,7 +151,7 @@ class ConfigRunTestCase(test.CdistTestCase):
"""Unknown type should be detected in the resolving process"""
first = self.object_index['__first/man']
first.requirements = ['__nosuchtype/not/exist']
with self.assertRaises(cdist.core.cdist_type.NoSuchTypeError):
with self.assertRaises(cdist.core.cdist_type.InvalidTypeError):
self.config.iterate_until_finished()
def test_requirement_singleton_where_no_singleton(self):

View file

@ -76,14 +76,14 @@ class EmulatorTestCase(test.CdistTestCase):
def test_nonexistent_type_exec(self):
argv = ['__does-not-exist']
self.assertRaises(core.cdist_type.NoSuchTypeError, emulator.Emulator,
self.assertRaises(core.cdist_type.InvalidTypeError, emulator.Emulator,
argv, env=self.env)
def test_nonexistent_type_requirement(self):
argv = ['__file', '/tmp/foobar']
self.env['require'] = '__does-not-exist/some-id'
emu = emulator.Emulator(argv, env=self.env)
self.assertRaises(core.cdist_type.NoSuchTypeError, emu.run)
self.assertRaises(core.cdist_type.InvalidTypeError, emu.run)
def test_illegal_object_id_requirement(self):
argv = ['__file', '/tmp/foobar']