Skip to content

Commit 7dfb41c

Browse files
committed
tests/cli(snapshot): Update add/discover expectations
why: Merge/no-merge flows change CLI logs; snapshots need to reflect the new output. what: - record Syrupy snapshots for the updated add path-mode cases - add a discover snapshot covering the no-merge warning messaging
1 parent dd5ba36 commit 7dfb41c

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# serializer version: 1
2+
# name: test_add_repo_duplicate_merge_behavior[merge-off]
3+
dict({
4+
'log': '''
5+
WARNING vcspull.cli.add:add.py:414 • Duplicate workspace root ~/study/python/ appears 2 times; skipping merge because --no-merge was provided.
6+
INFO vcspull.cli.add:add.py:558 ✓ Successfully added 'pytest-docker' (git+https://github.com/avast/pytest-docker.git) to <config> under '~/study/python/'.
7+
8+
''',
9+
'test_id': 'merge-off',
10+
})
11+
# ---
12+
# name: test_add_repo_duplicate_merge_behavior[merge-on]
13+
dict({
14+
'log': '''
15+
INFO vcspull.cli.add:add.py:395 • Merged 2 duplicate entries for workspace root ~/study/python/
16+
INFO vcspull.cli.add:add.py:558 ✓ Successfully added 'pytest-docker' (git+https://github.com/avast/pytest-docker.git) to <config> under '~/study/python/'.
17+
18+
''',
19+
'test_id': 'merge-on',
20+
})
21+
# ---
22+
# name: test_handle_add_command_path_mode[path-auto-confirm]
23+
dict({
24+
'log': '''
25+
INFO vcspull.cli.add:add.py:235 Found new repository to import:
26+
INFO vcspull.cli.add:add.py:236 + pytest-docker (https://github.com/avast/pytest-docker)
27+
INFO vcspull.cli.add:add.py:247 • workspace: ~/study/python/
28+
INFO vcspull.cli.add:add.py:255 ↳ path: ~/study/python/pytest-docker
29+
INFO vcspull.cli.add:add.py:276 ? Import this repository? [y/N]: y (auto-confirm)
30+
INFO vcspull.cli.add:add.py:374 Config file <config> not found. A new one will be created.
31+
INFO vcspull.cli.add:add.py:558 ✓ Successfully added 'pytest-docker' (git+https://github.com/avast/pytest-docker) to <config> under '~/study/python/'.
32+
33+
''',
34+
'test_id': 'path-auto-confirm',
35+
})
36+
# ---
37+
# name: test_handle_add_command_path_mode[path-interactive-accept]
38+
dict({
39+
'log': '''
40+
INFO vcspull.cli.add:add.py:235 Found new repository to import:
41+
INFO vcspull.cli.add:add.py:236 + project-alias (https://github.com/example/project)
42+
INFO vcspull.cli.add:add.py:247 • workspace: ~/study/python/
43+
INFO vcspull.cli.add:add.py:255 ↳ path: ~/study/python/pytest-docker
44+
INFO vcspull.cli.add:add.py:374 Config file <config> not found. A new one will be created.
45+
INFO vcspull.cli.add:add.py:558 ✓ Successfully added 'project-alias' (git+https://github.com/example/project) to <config> under '~/study/python/'.
46+
47+
''',
48+
'test_id': 'path-interactive-accept',
49+
})
50+
# ---
51+
# name: test_handle_add_command_path_mode[path-interactive-decline]
52+
dict({
53+
'log': '''
54+
INFO vcspull.cli.add:add.py:235 Found new repository to import:
55+
INFO vcspull.cli.add:add.py:236 + pytest-docker (https://github.com/example/decline)
56+
INFO vcspull.cli.add:add.py:247 • workspace: ~/study/python/
57+
INFO vcspull.cli.add:add.py:255 ↳ path: ~/study/python/pytest-docker
58+
INFO vcspull.cli.add:add.py:290 Aborted import of 'pytest-docker' from <repo_path>
59+
60+
''',
61+
'test_id': 'path-interactive-decline',
62+
})
63+
# ---
64+
# name: test_handle_add_command_path_mode[path-no-merge]
65+
dict({
66+
'log': '''
67+
INFO vcspull.cli.add:add.py:235 Found new repository to import:
68+
INFO vcspull.cli.add:add.py:236 + pytest-docker (https://github.com/example/no-merge)
69+
INFO vcspull.cli.add:add.py:247 • workspace: ~/study/python/
70+
INFO vcspull.cli.add:add.py:255 ↳ path: ~/study/python/pytest-docker
71+
INFO vcspull.cli.add:add.py:276 ? Import this repository? [y/N]: y (auto-confirm)
72+
WARNING vcspull.cli.add:add.py:414 • Duplicate workspace root ~/study/python/ appears 2 times; skipping merge because --no-merge was provided.
73+
INFO vcspull.cli.add:add.py:558 ✓ Successfully added 'pytest-docker' (git+https://github.com/example/no-merge) to <config> under '~/study/python/'.
74+
75+
''',
76+
'test_id': 'path-no-merge',
77+
})
78+
# ---
79+
# name: test_handle_add_command_path_mode[path-no-remote]
80+
dict({
81+
'log': '''
82+
WARNING vcspull.cli.add:add.py:213 Unable to determine git remote for <repo_path>; using local path in config.
83+
INFO vcspull.cli.add:add.py:235 Found new repository to import:
84+
INFO vcspull.cli.add:add.py:236 + pytest-docker (~/study/python/pytest-docker)
85+
INFO vcspull.cli.add:add.py:247 • workspace: ~/study/python/
86+
INFO vcspull.cli.add:add.py:255 ↳ path: ~/study/python/pytest-docker
87+
INFO vcspull.cli.add:add.py:276 ? Import this repository? [y/N]: y (auto-confirm)
88+
INFO vcspull.cli.add:add.py:374 Config file <config> not found. A new one will be created.
89+
INFO vcspull.cli.add:add.py:558 ✓ Successfully added 'pytest-docker' (<repo_path>) to <config> under '~/study/python/'.
90+
91+
''',
92+
'test_id': 'path-no-remote',
93+
})
94+
# ---
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# serializer version: 1
2+
# name: test_discover_repos[discover-no-merge]
3+
dict({
4+
'log': '''
5+
WARNING vcspull.cli.discover:discover.py:272 • Duplicate workspace root ~/code/ appears 2 times; skipping merge because --no-merge was provided.
6+
INFO vcspull.cli.discover:discover.py:469
7+
Found 1 new repository to import:
8+
INFO vcspull.cli.discover:discover.py:478 + repo3 (git+https://github.com/user/repo3.git)
9+
INFO vcspull.cli.discover:discover.py:527 + Importing 'repo3' (git+https://github.com/user/repo3.git) under '~/code/'.
10+
INFO vcspull.cli.discover:discover.py:546 ✓ Successfully updated <config>.
11+
12+
''',
13+
'test_id': 'discover-no-merge',
14+
})
15+
# ---

0 commit comments

Comments
 (0)