diff --git a/monkey/tests/unit_tests/monkey_island/cc/setup/test_mongo_setup.py b/monkey/tests/unit_tests/monkey_island/cc/setup/test_mongo_setup.py deleted file mode 100644 index 388e1a6c0..000000000 --- a/monkey/tests/unit_tests/monkey_island/cc/setup/test_mongo_setup.py +++ /dev/null @@ -1,24 +0,0 @@ -import os - -from monkey_island.cc.setup.mongo_setup import _create_db_dir - - -def test_create_db_dir(monkeypatch, tmpdir): - test_dir_name = "test_dir" - monkeypatch.setattr("monkey_island.cc.setup.mongo_setup.DB_DIR_NAME", test_dir_name) - expected_path = os.path.join(tmpdir, test_dir_name) - - db_path = _create_db_dir(tmpdir) - assert os.path.isdir(expected_path) - assert db_path == expected_path - - -def test_create_db_dir_already_created(monkeypatch, tmpdir): - test_dir_name = "test_dir" - monkeypatch.setattr("monkey_island.cc.setup.mongo_setup.DB_DIR_NAME", test_dir_name) - expected_path = os.path.join(tmpdir, test_dir_name) - os.mkdir(expected_path) - - db_path = _create_db_dir(tmpdir) - assert os.path.isdir(expected_path) - assert db_path == expected_path diff --git a/monkey/tests/unit_tests/monkey_island/cc/setup/test_process_runner.py b/monkey/tests/unit_tests/monkey_island/cc/setup/test_process_runner.py new file mode 100644 index 000000000..f4aec0ba8 --- /dev/null +++ b/monkey/tests/unit_tests/monkey_island/cc/setup/test_process_runner.py @@ -0,0 +1,24 @@ +import os + +from monkey_island.cc.setup.mongo_process_runner import MongoDbRunner + + +def test_create_db_dir(monkeypatch, tmpdir): + test_dir_name = "test_dir" + monkeypatch.setattr("monkey_island.cc.setup.mongo_process_runner.DB_DIR_NAME", test_dir_name) + expected_path = os.path.join(tmpdir, test_dir_name) + + db_path = MongoDbRunner(tmpdir, tmpdir)._create_db_dir() + assert os.path.isdir(expected_path) + assert db_path == expected_path + + +def test_create_db_dir__already_created(monkeypatch, tmpdir): + test_dir_name = "test_dir" + monkeypatch.setattr("monkey_island.cc.setup.mongo_process_runner.DB_DIR_NAME", test_dir_name) + expected_path = os.path.join(tmpdir, test_dir_name) + os.mkdir(expected_path) + + db_path = MongoDbRunner(tmpdir, tmpdir)._create_db_dir() + assert os.path.isdir(expected_path) + assert db_path == expected_path