|
5 | 5 |
|
6 | 6 |
|
7 | 7 | def test_checkout(xtl_clone, git2cpp_path, tmp_path, run_in_tmp_path):
|
| 8 | + assert (tmp_path / "xtl").exists() |
| 9 | + xtl_path = tmp_path / "xtl" |
| 10 | + |
8 | 11 | create_cmd = [git2cpp_path, 'branch', 'foregone']
|
9 |
| - p_create = subprocess.run(create_cmd, capture_output=True, cwd=tmp_path, text=True) |
| 12 | + p_create = subprocess.run(create_cmd, capture_output=True, cwd=xtl_path, text=True) |
10 | 13 | assert p_create.returncode == 0
|
11 | 14 |
|
12 | 15 | checkout_cmd = [git2cpp_path, 'checkout', 'foregone']
|
13 |
| - p_checkout = subprocess.run(checkout_cmd, capture_output=True, cwd=tmp_path, text=True) |
| 16 | + p_checkout = subprocess.run(checkout_cmd, capture_output=True, cwd=xtl_path, text=True) |
14 | 17 | assert p_checkout.returncode == 0
|
15 | 18 | assert(p_checkout.stdout == '');
|
16 | 19 |
|
17 | 20 | branch_cmd = [git2cpp_path, 'branch']
|
18 |
| - p_branch = subprocess.run(branch_cmd, capture_output=True, cwd=tmp_path, text=True) |
| 21 | + p_branch = subprocess.run(branch_cmd, capture_output=True, cwd=xtl_path, text=True) |
19 | 22 | assert p_branch.returncode == 0
|
20 | 23 | assert(p_branch.stdout == '* foregone\n master\n')
|
21 | 24 |
|
22 | 25 | checkout_cmd[2] = 'master'
|
23 |
| - p_checkout2 = subprocess.run(checkout_cmd, capture_output=True, cwd=tmp_path, text=True) |
| 26 | + p_checkout2 = subprocess.run(checkout_cmd, capture_output=True, cwd=xtl_path, text=True) |
24 | 27 | assert p_checkout2.returncode == 0
|
25 | 28 |
|
26 | 29 |
|
27 | 30 | def test_checkout_b(xtl_clone, git2cpp_path, tmp_path, run_in_tmp_path):
|
| 31 | + assert (tmp_path / "xtl").exists() |
| 32 | + xtl_path = tmp_path / "xtl" |
| 33 | + |
28 | 34 | checkout_cmd = [git2cpp_path, 'checkout', '-b', 'foregone']
|
29 |
| - p_checkout = subprocess.run(checkout_cmd, capture_output=True, cwd=tmp_path, text=True) |
| 35 | + p_checkout = subprocess.run(checkout_cmd, capture_output=True, cwd=xtl_path, text=True) |
30 | 36 | assert p_checkout.returncode == 0
|
31 | 37 | assert(p_checkout.stdout == '');
|
32 | 38 |
|
33 | 39 | branch_cmd = [git2cpp_path, 'branch']
|
34 |
| - p_branch = subprocess.run(branch_cmd, capture_output=True, cwd=tmp_path, text=True) |
| 40 | + p_branch = subprocess.run(branch_cmd, capture_output=True, cwd=xtl_path, text=True) |
35 | 41 | assert p_branch.returncode == 0
|
36 | 42 | assert(p_branch.stdout == '* foregone\n master\n')
|
37 | 43 |
|
38 | 44 | checkout_cmd.remove('-b')
|
39 | 45 | checkout_cmd[2] = 'master'
|
40 |
| - p_checkout2 = subprocess.run(checkout_cmd, cwd=tmp_path, text=True) |
| 46 | + p_checkout2 = subprocess.run(checkout_cmd, cwd=xtl_path, text=True) |
41 | 47 | assert p_checkout2.returncode == 0
|
0 commit comments