Ejemplo n.º 1
0
    def test_in_part(self):
        """get_python_home should support in-part python"""

        stage_dir = 'stage_dir'
        install_dir = 'install_dir'

        # Create installed binary
        self._create_python_binary(install_dir)

        python_home = _python_finder.get_python_home(
            'test', stage_dir=stage_dir, install_dir=install_dir)
        self.assertThat(python_home, Equals(os.path.join(install_dir, 'usr')))
Ejemplo n.º 2
0
    def test_staged(self):
        """get_python_home should support staged python"""

        stage_dir = "stage_dir"
        install_dir = "install_dir"

        # Create staged binary
        self._create_python_binary(stage_dir)

        python_home = _python_finder.get_python_home(
            "test", stage_dir=stage_dir, install_dir=install_dir
        )
        self.assertThat(python_home, Equals(os.path.join(stage_dir, "usr")))
Ejemplo n.º 3
0
    def test_staged_and_in_part(self):
        """get_python_home should prefer staged python over in-part"""

        stage_dir = 'stage_dir'
        install_dir = 'install_dir'

        # Create both staged and installed binaries
        self._create_python_binary(stage_dir)
        self._create_python_binary(install_dir)

        python_home = _python_finder.get_python_home(
            'test', stage_dir=stage_dir, install_dir=install_dir)
        self.assertThat(python_home, Equals(os.path.join(stage_dir, 'usr')))