|
@@ 60-73 (lines=14) @@
|
| 57 |
|
return _run_cli |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
def test_track_without_modification(repo, create_scenario, run_cli): |
| 61 |
|
imports_for_file_a = ['from a.b import c\n', 'from d.e import f\n'] |
| 62 |
|
imports_for_file_b = ['from g.h import i\n', 'from j.k import l\n'] |
| 63 |
|
|
| 64 |
|
create_scenario(repo, imports_for_file_a, imports_for_file_b) |
| 65 |
|
|
| 66 |
|
result = run_cli(repo) |
| 67 |
|
|
| 68 |
|
assert result.exit_code == 0 |
| 69 |
|
assert "test_list_output.py" in result.output |
| 70 |
|
|
| 71 |
|
output_file = _output_file(repo) |
| 72 |
|
with open(output_file, mode='r') as file: |
| 73 |
|
assert "imports_to_move = []" in file.read() |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
def test_track_with_modification(repo, create_scenario, run_cli): |
|
@@ 76-88 (lines=13) @@
|
| 73 |
|
assert "imports_to_move = []" in file.read() |
| 74 |
|
|
| 75 |
|
|
| 76 |
|
def test_track_with_modification(repo, create_scenario, run_cli): |
| 77 |
|
imports_for_file_a = ['from a.b import c\n', 'from d.e import f\n'] |
| 78 |
|
imports_for_file_b = ['from x.x import c\n', 'from j.k import l\n'] |
| 79 |
|
create_scenario(repo, imports_for_file_a, imports_for_file_b) |
| 80 |
|
|
| 81 |
|
result = run_cli(repo) |
| 82 |
|
|
| 83 |
|
assert result.exit_code == 0 |
| 84 |
|
assert "test_list_output.py" in result.output |
| 85 |
|
|
| 86 |
|
output_file = _output_file(repo) |
| 87 |
|
with open(output_file, mode='r') as file: |
| 88 |
|
assert "imports_to_move = [('a.b.c', 'x.x.c')]" in file.read() |
| 89 |
|
|
| 90 |
|
|
| 91 |
|
def test_track_with_conflict(repo, create_scenario, run_cli): |