1import json
2import pathlib
3import platform
4import unittest
5
6from python.runfiles import runfiles
7
8
9class RunTest(unittest.TestCase):
10    def test_ran(self):
11        rf = runfiles.Create()
12        settings_path = rf.Rlocation(
13            "rules_python/tests/support/current_build_settings.json"
14        )
15        settings = json.loads(pathlib.Path(settings_path).read_text())
16        if platform.system() == "Windows":
17            self.assertEqual(
18                "/_magic_pyruntime_sentinel_do_not_use", settings["interpreter_path"]
19            )
20        else:
21            self.assertIn(
22                "runtime_env_toolchain_interpreter.sh",
23                settings["interpreter"]["short_path"],
24            )
25
26
27if __name__ == "__main__":
28    unittest.main()
29