def workspace_config(tmp_path): # a workspace with one remote host and all default values workspace_root = tmp_path / "workspace" workspace_root.mkdir() config = WorkspaceConfig.empty(workspace_root) config.configurations.append( RemoteConfig(host="test-host.example.com", directory=Path("remote/dir"), shell="sh", shell_options="") ) return config
def test_add_host_to_workspace(tmp_path): config = WorkspaceConfig.empty(tmp_path) added, index = config.add_remote_host("test-host", Path("remote/dir")) assert added assert index == 0 assert config.default_configuration == 0 assert len(config.configurations) == 1 assert config.configurations[0] == RemoteConfig( host="test-host", directory=Path("remote/dir"), shell="sh", shell_options="")