Exemplo n.º 1
0
 def test_get_version_from_executable_raise(self, fake_process: FakeProcess) -> None:
     """Test get_version_from_executable raise exception."""
     fake_process.register_subprocess(
         ["usr/tfenv/terraform", "-version"], returncode=1
     )
     with pytest.raises(
         subprocess.CalledProcessError, match="returned non-zero exit status 1"
     ):
         TFEnvManager.get_version_from_executable("usr/tfenv/terraform")
Exemplo n.º 2
0
 def test_get_version_from_executable(
     self,
     expected: Optional[VersionTuple],
     fake_process: FakeProcess,
     output: str,
 ) -> None:
     """Test get_version_from_executable."""
     fake_process.register_subprocess(
         ["usr/tfenv/terraform", "-version"], stdout=output
     )
     assert (
         TFEnvManager.get_version_from_executable("usr/tfenv/terraform") == expected
     )