def test_nodejs_not_set(self): buildconfig.substs["NODEJS"] = None with self.assertRaises(SystemExit) as cm: generate("dummy_arg", TEST_SCRIPT) self.assertEqual(cm.exception.code, 1)
def test_called_process_error_handled(self): SCRIPT_ALLOWLIST.append(NONEXISTENT_TEST_SCRIPT) with self.assertRaises(SystemExit) as cm: generate("dummy_arg", NONEXISTENT_TEST_SCRIPT) self.assertEqual(cm.exception.code, 1) SCRIPT_ALLOWLIST.remove(NONEXISTENT_TEST_SCRIPT)
def test_generate_missing_allowlist_entry_exit_code(self): SCRIPT_ALLOWLIST.remove(TEST_SCRIPT) with self.assertRaises(SystemExit) as cm: generate("dummy_arg", TEST_SCRIPT) self.assertEqual(cm.exception.code, 1)
def test_generate_returns_passed_deps(self): deps = generate("dummy_argument", TEST_SCRIPT, "a", "b") self.assertSetEqual(deps, set([u"a", u"b"]))
def test_generate_no_returned_deps(self): deps = generate("dummy_argument", TEST_SCRIPT) self.assertSetEqual(deps, set([]))