forked from p15670423/monkey
UT's: assert correct behavior on docker if empty data directory is present and if no version file, but other files are present in the data directory
This commit is contained in:
parent
9ef9ba0024
commit
01f8488b07
|
@ -102,7 +102,7 @@ def test_new_data_dir_docker(monkeypatch, temp_data_dir_path, temp_version_file_
|
|||
assert bogus_file_path.is_file()
|
||||
|
||||
|
||||
def test_old_data_dir_docker(monkeypatch, temp_data_dir_path, temp_version_file_path):
|
||||
def test_data_dir_docker_old_version(monkeypatch, temp_data_dir_path, temp_version_file_path):
|
||||
monkeypatch.setenv(DOCKER_ENV_VAR, "true")
|
||||
|
||||
temp_data_dir_path.mkdir()
|
||||
|
@ -110,3 +110,22 @@ def test_old_data_dir_docker(monkeypatch, temp_data_dir_path, temp_version_file_
|
|||
|
||||
with pytest.raises(IncompatibleDataDirectory):
|
||||
setup_data_dir(temp_data_dir_path)
|
||||
|
||||
|
||||
def test_empty_data_dir_docker(monkeypatch, temp_data_dir_path, temp_version_file_path):
|
||||
monkeypatch.setenv(DOCKER_ENV_VAR, "true")
|
||||
|
||||
temp_data_dir_path.mkdir()
|
||||
|
||||
setup_data_dir(temp_data_dir_path)
|
||||
assert temp_version_file_path.read_text() == current_version
|
||||
|
||||
|
||||
def test_old_data_dir_docker_no_version(monkeypatch, temp_data_dir_path):
|
||||
monkeypatch.setenv(DOCKER_ENV_VAR, "true")
|
||||
|
||||
temp_data_dir_path.mkdir()
|
||||
create_bogus_file(temp_data_dir_path)
|
||||
|
||||
with pytest.raises(IncompatibleDataDirectory):
|
||||
setup_data_dir(temp_data_dir_path)
|
||||
|
|
Loading…
Reference in New Issue