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