def test_prepare_sbdc_path_tmp(mock_os): mock_os.access.return_value = False mock_os.path = os.path exists, path = _prepare_sbdc_path("unexisting_folder") assert path == "/tmp/.sbdc/datasets/unexisting_folder" assert exists is False
def test_prepare_sbdc_path_tmp_missing(mock_os, mock_path): mock_os.access.return_value = False mock_os.makedirs.return_value = True mock_path.exists.return_value = False mock_path.join = os.path.join exists, path = _prepare_sbdc_path("unexisting_folder") mock_os.makedirs.assert_called_with("/tmp/.sbdc/datasets") assert path == "/tmp/.sbdc/datasets/unexisting_folder"