diff --git a/tests/test_language_java.py b/tests/test_language_java.py index 8799cfbf3..c24f25497 100644 --- a/tests/test_language_java.py +++ b/tests/test_language_java.py @@ -256,6 +256,20 @@ def test_release_please_handle_releases(): ) +def test_merge_partials(): + os.chdir(FIXTURES / "java_templates" / "partials") + with util.copied_fixtures_dir(FIXTURES / "java_templates" / "partials"): + java.common_templates( + template_path=TEMPLATES_PATH, + partial_files=[".kokoro/nightly/integration.cfg-partials.yaml"] + ) + assert os.path.isfile(".kokoro/nightly/integration.cfg") + os.system("cat .kokoro/nightly/integration.cfg") + assert_matches_golden( + "integration-golden.cfg", ".kokoro/nightly/integration.cfg" + ) + + def assert_matches_golden(expected, actual): matching_lines = 0 with open(actual, "rt") as fp: @@ -268,18 +282,3 @@ def assert_matches_golden(expected, actual): if not log_line: break assert matching_lines > 0 - - -class TestJava(unittest.TestCase): - def test_merge_partials(self): - os.chdir(FIXTURES / "java_templates" / "partials") - with util.copied_fixtures_dir(FIXTURES / "java_templates" / "partials"): - java.common_templates( - template_path=TEMPLATES_PATH, - partial_files=[".kokoro/nightly/integration.cfg-partials.yaml"] - ) - assert os.path.isfile(".kokoro/nightly/integration.cfg") - os.system("cat .kokoro/nightly/integration.cfg") - assert_matches_golden( - "integration-golden.cfg", ".kokoro/nightly/integration.cfg" - )