Complete the code to change the current working directory using monkeypatch.
def test_change_dir(monkeypatch): monkeypatch.[1]('/tmp') import os assert os.getcwd() == '/tmp'
The monkeypatch.chdir method changes the current working directory temporarily during the test.
Complete the code to verify the directory change inside the test.
def test_dir(monkeypatch): monkeypatch.chdir('/var') import os assert os.getcwd() == [1]
After monkeypatch.chdir('/var'), the current working directory should be '/var'.
Fix the error in the test code to correctly change directory using monkeypatch.
def test_fix_dir(monkeypatch): monkeypatch.[1]('/home/user') import os assert os.getcwd() == '/home/user'
The correct method to change the current directory is monkeypatch.chdir.
Fill both blanks to create a test that changes directory and asserts the new path.
def test_dir_change(monkeypatch): monkeypatch.[1]('/etc') import os assert os.getcwd() == [2]
Use monkeypatch.chdir to change directory and assert the same path string.
Fill all three blanks to write a test that changes directory, imports os, and asserts the current directory.
def test_full(monkeypatch): monkeypatch.[1]([2]) import os assert os.getcwd() == [3]
The test uses monkeypatch.chdir with the directory string '/opt' and asserts the current working directory matches.