예제 #1
0
def test_init():
    input_file = "input.py"
    output_file = "output.py"

    updater = files.FileUpdater(input_file, output_file)
    assert input_file == updater.input_path
    assert output_file == updater.output_path
예제 #2
0
def test_make_output_dirs_if_needed_overwrite_with_warning(
        os_path_exists, caplog):
    output_file = "output.py"

    updater = files.FileUpdater("input.py", output_file)
    updater._make_output_dirs_if_needed()

    assert "Overwriting file {}".format(output_file) in caplog.text
예제 #3
0
def test_make_output_dirs_if_needed_make_path(makedirs):
    output_dir = "dir"
    output_path = os.path.join(output_dir, "output.py")

    updater = files.FileUpdater("input.py", output_path)
    updater._make_output_dirs_if_needed()

    makedirs.assert_called_with(output_dir)