Merge "Improve debugging of missing elements."

This commit is contained in:
Jenkins 2013-06-21 08:07:49 +00:00 committed by Gerrit Code Review
commit 1a681d3a4f
2 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,8 @@ def dependencies(element, elements_dir=None):
else: else:
raise raise
sys.stderr.write("ERROR: Element %s doesn't exists\n" % (element, )) sys.stderr.write("ERROR: Element '%s' not found in '%s'\n" %
(element, elements_dir))
exit(-1) exit(-1)

View File

@ -52,6 +52,10 @@ class TestElementDeps(TestCase):
elements_dir=self.element_dir) elements_dir=self.element_dir)
self.assertEquals(set(['requires-foo', 'foo']), result) self.assertEquals(set(['requires-foo', 'foo']), result)
def test_missing_deps(self):
self.assertRaises(SystemExit, expand_dependencies, ['fake'],
self.element_dir)
def test_transitive_deps(self): def test_transitive_deps(self):
result = expand_dependencies(['requires-requires-foo'], result = expand_dependencies(['requires-requires-foo'],
elements_dir=self.element_dir) elements_dir=self.element_dir)