def test_package_all(self): regr_data = os.path.join(os.path.dirname(os.path.abspath(__file__)), "regrtest_data") sys.path.insert(0, regr_data) try: linter.check(os.path.join(regr_data, "package_all")) got = linter.reporter.finalize().strip() self.assertEqual(got, "E: 3: Undefined variable name " "'missing' in __all__") finally: sys.path.pop(0)
def test_package_all() -> None: sys.path.insert(0, REGR_DATA_DIR) try: linter.check([os.path.join(REGR_DATA_DIR, "package_all")]) got = linter.reporter.finalize().strip() assert got == "E: 3: Undefined variable name 'missing' in __all__" finally: sys.path.pop(0)
def test_package_all(self): regr_data = os.path.join(os.path.dirname(os.path.abspath(__file__)), "regrtest_data") sys.path.insert(0, regr_data) try: linter.check(os.path.join(regr_data, "package_all")) got = linter.reporter.finalize().strip() assert got == "E: 3: Undefined variable name 'missing' in __all__" finally: sys.path.pop(0)
def test_package_all(self): regr_data = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'regrtest_data') sys.path.insert(0, regr_data) try: linter.check(os.path.join(regr_data, 'package_all')) got = linter.reporter.finalize().strip() assert got == "E: 3: Undefined variable name 'missing' in __all__" finally: sys.path.pop(0)
def test_package_all(self): regr_data = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'regrtest_data') sys.path.insert(0, regr_data) try: linter.check(os.path.join(regr_data, 'package_all')) got = linter.reporter.finalize().strip() self.assertEqual(got, "E: 3: Undefined variable name " "'missing' in __all__") finally: sys.path.pop(0)
def test_empty_settings(self): linter.check('settings.empty.settings') got = linter.reporter.finalize().strip() self.assertEqual( got, '''E: 5: Empty setting "ALLOWED_HOSTS" E: 6: Empty setting "STATIC_ROOT"''')
def test_required_setting_missed(self): linter.check('settings.required.settings') got = linter.reporter.finalize().strip() self.assertEqual( got, """E: 1: Required setting "ALLOWED_HOSTS" is missed E: 1: Required setting "STATIC_ROOT" is missed""")