Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/tests/sync/
Date: Tue, 31 Jan 2017 21:03:20
Message-Id: 1485896570.0655b4a26e378cf409c9a033514f41c307d01371.zmedico@gentoo
1 commit: 0655b4a26e378cf409c9a033514f41c307d01371
2 Author: Alexandru Elisei <alexandru.elisei <AT> gmail <DOT> com>
3 AuthorDate: Sun Jan 29 18:07:34 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 31 21:02:50 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=0655b4a2
7
8 test_sync_local: add test for auto-sync set to 'no'
9
10 pym/portage/tests/sync/test_sync_local.py | 12 ++++++++++--
11 1 file changed, 10 insertions(+), 2 deletions(-)
12
13 diff --git a/pym/portage/tests/sync/test_sync_local.py b/pym/portage/tests/sync/test_sync_local.py
14 index bec2e6a..1d38562 100644
15 --- a/pym/portage/tests/sync/test_sync_local.py
16 +++ b/pym/portage/tests/sync/test_sync_local.py
17 @@ -42,7 +42,7 @@ class SyncLocalTestCase(TestCase):
18 location = %(EPREFIX)s/var/repositories/test_repo
19 sync-type = %(sync-type)s
20 sync-uri = file:/%(EPREFIX)s/var/repositories/test_repo_sync
21 - auto-sync = yes
22 + auto-sync = %(auto-sync)s
23 %(repo_extra_keys)s
24 """)
25
26 @@ -87,9 +87,11 @@ class SyncLocalTestCase(TestCase):
27 committer_name = "Gentoo Dev"
28 committer_email = "gentoo-dev@g.o"
29
30 - def repos_set_conf(sync_type, dflt_keys=None, xtra_keys=None):
31 + def repos_set_conf(sync_type, dflt_keys=None, xtra_keys=None,
32 + auto_sync="yes"):
33 env["PORTAGE_REPOSITORIES"] = repos_conf % {\
34 "EPREFIX": eprefix, "sync-type": sync_type,
35 + "auto-sync": auto_sync,
36 "default_keys": "" if dflt_keys is None else dflt_keys,
37 "repo_extra_keys": "" if xtra_keys is None else xtra_keys}
38
39 @@ -100,6 +102,12 @@ class SyncLocalTestCase(TestCase):
40 os.unlink(os.path.join(metadata_dir, 'timestamp.chk'))
41
42 sync_cmds = (
43 + (homedir, lambda: repos_set_conf("rsync", auto_sync="no")),
44 + (homedir, cmds["emerge"] + ("--sync",)),
45 + (homedir, lambda: self.assertFalse(os.path.exists(
46 + os.path.join(repo.location, "dev-libs", "A")
47 + ), "dev-libs/A found, expected missing")),
48 + (homedir, lambda: repos_set_conf("rsync", auto_sync="yes")),
49 (homedir, cmds["emerge"] + ("--sync",)),
50 (homedir, lambda: self.assertTrue(os.path.exists(
51 os.path.join(repo.location, "dev-libs", "A")