Example #1
0
 def test_set_version_same(self, mocker: MockerFixture, tmp_path: Path) -> None:
     """Test set_version same."""
     version = mocker.patch.object(TFEnvManager, "version")
     tfenv = TFEnvManager(tmp_path)
     tfenv.current_version = "0.15.5"
     assert not tfenv.set_version("0.15.5")
     assert tfenv.current_version == "0.15.5"
     assert tfenv.version == version
Example #2
0
 def test_set_version(self, mocker: MockerFixture, tmp_path: Path) -> None:
     """Test set_version."""
     version = VersionTuple(0, 15, 5)
     mocker.patch.object(TFEnvManager, "versions_dir", tmp_path)
     mocker.patch.object(TFEnvManager, "get_version_from_file", return_value=None)
     tfenv = TFEnvManager(tmp_path)
     (tfenv.versions_dir / str(version)).mkdir()
     assert not tfenv.current_version
     assert not tfenv.set_version(str(version))
     assert tfenv.version == version
     assert tfenv.current_version == str(version)