diff options
author | Marcos Marado <mindboosternoori@gmail.com> | 2020-04-09 19:44:28 +0100 |
---|---|---|
committer | Marcos Marado <mindboosternoori@gmail.com> | 2020-04-12 17:12:14 +0000 |
commit | 2735bfc5ff6599fd3ca9a361484259908d03804d (patch) | |
tree | 624fdda61fa690fdb44b9fb5621581e60296a36a /tests | |
parent | 653f8b711be3344e8c617512629270661b24fa86 (diff) | |
download | git-repo-2735bfc5ff6599fd3ca9a361484259908d03804d.tar.gz |
tests: fix SetupGnuPG test
The SetupGnuPG test tries to test the full setup, including the
creation of the directories. In order to do that, it create a
temporary directory, and redefines the home_dot_repo to point there.
When a home_dot_repo directory does not exist, it should be created.
The gpg_dir, which should exist inside home_dot_repo, also needs to be
created if it does not exist. However, since the gpg_dir path is
relative to home_dot_repo, once we redefine one, we need to redifine
the other.
The failure of this test might have gone unnoticed so far, since in
only fails if you do not have a ~/.repoconfig/gnupg/ on the
environment you are running the tests on.
Change-Id: Ic69d59e56137eea43349a61b5cf81f215c6a7f9a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/262573
Reviewed-by: Mike Frysinger <vapier@google.com>
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Tested-by: Marcos Marado <mindboosternoori@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_wrapper.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 136f7f11..e18ceb19 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py | |||
@@ -304,6 +304,7 @@ class SetupGnuPG(RepoWrapperTestCase): | |||
304 | """Make sure it works completely.""" | 304 | """Make sure it works completely.""" |
305 | with TemporaryDirectory() as tempdir: | 305 | with TemporaryDirectory() as tempdir: |
306 | self.wrapper.home_dot_repo = tempdir | 306 | self.wrapper.home_dot_repo = tempdir |
307 | self.wrapper.gpg_dir = os.path.join(self.wrapper.home_dot_repo, 'gnupg') | ||
307 | self.assertTrue(self.wrapper.SetupGnuPG(True)) | 308 | self.assertTrue(self.wrapper.SetupGnuPG(True)) |
308 | with open(os.path.join(tempdir, 'keyring-version'), 'r') as fp: | 309 | with open(os.path.join(tempdir, 'keyring-version'), 'r') as fp: |
309 | data = fp.read() | 310 | data = fp.read() |