def test_prod_to_test_does_no_exist(): os.path.exists.return_value = False assert get_alternate("/path/to/foo.py") == "/path/to/test/test_foo.py" assert os.makedirs.call_args == mock.call("/path/to/test")
def test_test_to_prod(): assert get_alternate("/path/to/test/test_foo.py") == "/path/to/foo.py"
def test_prod_to_test_exists(): os.path.exists.return_value = True assert get_alternate("/path/to/foo.py") == "/path/to/test/test_foo.py" assert os.makedirs.called is False