1 |
commit: 82823b0c4de0a7cbb5654bb19d63aef874800afd |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jul 5 10:18:55 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jul 5 10:19:23 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=82823b0c |
7 |
|
8 |
test_sync_local: fix GitSync coverage |
9 |
|
10 |
Fixes: 0655b4a26e37 ("test_sync_local: add test for auto-sync set to 'no'") |
11 |
|
12 |
pym/portage/tests/sync/test_sync_local.py | 15 +++++++++------ |
13 |
1 file changed, 9 insertions(+), 6 deletions(-) |
14 |
|
15 |
diff --git a/pym/portage/tests/sync/test_sync_local.py b/pym/portage/tests/sync/test_sync_local.py |
16 |
index 010c8f887..17ff6f200 100644 |
17 |
--- a/pym/portage/tests/sync/test_sync_local.py |
18 |
+++ b/pym/portage/tests/sync/test_sync_local.py |
19 |
@@ -102,17 +102,20 @@ class SyncLocalTestCase(TestCase): |
20 |
os.unlink(os.path.join(metadata_dir, 'timestamp.chk')) |
21 |
|
22 |
sync_cmds = ( |
23 |
+ (homedir, cmds["emerge"] + ("--sync",)), |
24 |
+ (homedir, lambda: self.assertTrue(os.path.exists( |
25 |
+ os.path.join(repo.location, "dev-libs", "A") |
26 |
+ ), "dev-libs/A expected, but missing")), |
27 |
+ (homedir, cmds["emaint"] + ("sync", "-A")), |
28 |
+ ) |
29 |
+ |
30 |
+ sync_cmds_auto_sync = ( |
31 |
(homedir, lambda: repos_set_conf("rsync", auto_sync="no")), |
32 |
(homedir, cmds["emerge"] + ("--sync",)), |
33 |
(homedir, lambda: self.assertFalse(os.path.exists( |
34 |
os.path.join(repo.location, "dev-libs", "A") |
35 |
), "dev-libs/A found, expected missing")), |
36 |
(homedir, lambda: repos_set_conf("rsync", auto_sync="yes")), |
37 |
- (homedir, cmds["emerge"] + ("--sync",)), |
38 |
- (homedir, lambda: self.assertTrue(os.path.exists( |
39 |
- os.path.join(repo.location, "dev-libs", "A") |
40 |
- ), "dev-libs/A expected, but missing")), |
41 |
- (homedir, cmds["emaint"] + ("sync", "-A")), |
42 |
) |
43 |
|
44 |
rename_repo = ( |
45 |
@@ -236,7 +239,7 @@ class SyncLocalTestCase(TestCase): |
46 |
# triggered by python -Wd will be visible. |
47 |
stdout = subprocess.PIPE |
48 |
|
49 |
- for cwd, cmd in rename_repo + sync_cmds + \ |
50 |
+ for cwd, cmd in rename_repo + sync_cmds_auto_sync + sync_cmds + \ |
51 |
rsync_opts_repos + rsync_opts_repos_default + \ |
52 |
rsync_opts_repos_default_ovr + rsync_opts_repos_default_cancel + \ |
53 |
delete_sync_repo + git_repo_create + sync_type_git + \ |