Add fixture for fake db dir in test_process_runner.py

This commit is contained in:
Shreya 2021-05-26 19:02:11 +05:30 committed by VakarisZ
parent 58745a0eb4
commit 0be8e56858
2 changed files with 7 additions and 1 deletions

View File

@ -7,9 +7,13 @@ from monkey_island.cc.setup.mongo_process_runner import MongoDbRunner
TEST_DIR_NAME = "test_dir" TEST_DIR_NAME = "test_dir"
@pytest.fixture(autouse=True)
def fake_db_dir(monkeypatch, tmpdir):
monkeypatch.setattr("monkey_island.cc.setup.mongo_process_runner.DB_DIR_NAME", TEST_DIR_NAME)
@pytest.fixture @pytest.fixture
def expected_path(monkeypatch, tmpdir): def expected_path(monkeypatch, tmpdir):
monkeypatch.setattr("monkey_island.cc.setup.mongo_process_runner.DB_DIR_NAME", TEST_DIR_NAME)
expected_path = os.path.join(tmpdir, TEST_DIR_NAME) expected_path = os.path.join(tmpdir, TEST_DIR_NAME)
return expected_path return expected_path

View File

@ -166,6 +166,8 @@ IBM # unused variable (monkey/common/cloud/environment_names.py:11)
DigitalOcean # unused variable (monkey/common/cloud/environment_names.py:12) DigitalOcean # unused variable (monkey/common/cloud/environment_names.py:12)
_.aws_info # unused attribute (monkey/monkey_island/cc/environment/aws.py:13) _.aws_info # unused attribute (monkey/monkey_island/cc/environment/aws.py:13)
build_from_config_file_contents # unused method 'build_from_config_file_contents' (\monkey_island\setup\island_config_options.py:18) build_from_config_file_contents # unused method 'build_from_config_file_contents' (\monkey_island\setup\island_config_options.py:18)
fake_db_dir # unused function 'fake_db_dir' (monkey/tests/unit_tests/monkey_island/cc/setup/test_process_runner.py:10)
# these are not needed for it to work, but may be useful extra information to understand what's going on # these are not needed for it to work, but may be useful extra information to understand what's going on
WINDOWS_PBA_TYPE # unused variable (monkey/monkey_island/cc/resources/pba_file_upload.py:23) WINDOWS_PBA_TYPE # unused variable (monkey/monkey_island/cc/resources/pba_file_upload.py:23)