summaryrefslogtreecommitdiffstats
path: root/library/python/testing/yatest_common/ut/test.py
blob: bffdf1e35355c55f6091384a976a5f642331a5a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
import tarfile

import yatest.common

import yalibrary.tools


def test_jdk_from_package_equals_jdk_tool_from_yaconf_json():
    jdk_path = yatest.common.binary_path(os.path.join('build', 'platform', 'java', 'jdk', 'testing'))
    os.makedirs("extracted")
    with tarfile.open(os.path.join(jdk_path, "jdk.tar")) as tf:
        tf.extractall("extracted")
    jdk_tool_path = yalibrary.tools.toolchain_root('java', None, None)
    with open(os.path.join("extracted", "release")) as jdk_path_release:
        with open(os.path.join(jdk_tool_path, "release")) as jdk_tool_path_release:
            assert jdk_path_release.read() == jdk_tool_path_release.read()