forked from p15670423/monkey
Remove unneeded function arguments in test_mongo_process_runner.py
This commit is contained in:
parent
1610860bd0
commit
f5f8f572f6
|
@ -8,23 +8,23 @@ TEST_DIR_NAME = "test_dir"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def fake_db_dir(monkeypatch, tmpdir):
|
def fake_db_dir(monkeypatch):
|
||||||
monkeypatch.setattr("monkey_island.cc.setup.mongo_process_runner.DB_DIR_NAME", TEST_DIR_NAME)
|
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(tmpdir):
|
||||||
expected_path = os.path.join(tmpdir, TEST_DIR_NAME)
|
expected_path = os.path.join(tmpdir, TEST_DIR_NAME)
|
||||||
return expected_path
|
return expected_path
|
||||||
|
|
||||||
|
|
||||||
def test_create_db_dir(monkeypatch, tmpdir, expected_path):
|
def test_create_db_dir(tmpdir, expected_path):
|
||||||
db_path = MongoDbRunner(tmpdir, tmpdir)._create_db_dir()
|
db_path = MongoDbRunner(tmpdir, tmpdir)._create_db_dir()
|
||||||
assert os.path.isdir(expected_path)
|
assert os.path.isdir(expected_path)
|
||||||
assert db_path == expected_path
|
assert db_path == expected_path
|
||||||
|
|
||||||
|
|
||||||
def test_create_db_dir__already_created(monkeypatch, tmpdir, expected_path):
|
def test_create_db_dir__already_created(tmpdir, expected_path):
|
||||||
os.mkdir(expected_path)
|
os.mkdir(expected_path)
|
||||||
|
|
||||||
db_path = MongoDbRunner(tmpdir, tmpdir)._create_db_dir()
|
db_path = MongoDbRunner(tmpdir, tmpdir)._create_db_dir()
|
||||||
|
|
Loading…
Reference in New Issue