diff options
| author | Robert Myers <robert.myers@rackspace.com> | 2013-02-15 14:32:07 -0600 |
|---|---|---|
| committer | Robert Myers <robert.myers@rackspace.com> | 2013-02-15 14:32:07 -0600 |
| commit | 8ce59472653439d646309395bf195ec6163ff29a (patch) | |
| tree | 1470bc5159bfa71ab387cfea9c097bdee365a504 /tests/unit/test_setup.py | |
| parent | 7417a6024c7fe093a54f07a1ea4f24bdd0fcc3e6 (diff) | |
Change the check for the existence of .git directory.
In common setup the check for the .git directory is too
restrictive. Instead of checking that it is a directory just
check to see if it exists. That way if the project is part
of a submodule it will continue to work correctly.
Change-Id: If6b6531ab5778ac17537e3f18bde1844620c8316
Fixes: bug 1126416
Diffstat (limited to 'tests/unit/test_setup.py')
| -rw-r--r-- | tests/unit/test_setup.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/unit/test_setup.py b/tests/unit/test_setup.py index 8f6324d..60e2e6f 100644 --- a/tests/unit/test_setup.py +++ b/tests/unit/test_setup.py @@ -83,10 +83,11 @@ class GitLogsTest(utils.BaseTestCase): super(GitLogsTest, self).setUp() temp_path = self.useFixture(fixtures.TempDir()).path self.useFixture(DiveDir(temp_path)) - self.useFixture(fixtures.MonkeyPatch("os.path.isdir", - lambda path: path == ".git")) def test_write_git_changelog(self): + exist_files = [".git", ".mailmap"] + self.useFixture(fixtures.MonkeyPatch("os.path.exists", + lambda path: path in exist_files)) self.useFixture(fixtures.FakePopen(lambda _: { "stdout": StringIO.StringIO("Author: Foo Bar <email@bar.com>\n") })) @@ -102,6 +103,9 @@ class GitLogsTest(utils.BaseTestCase): author_old = "Foo Foo <email@foo.com>" author_new = "Bar Bar <email@bar.com>" + exist_files = [".git", "AUTHORS.in"] + self.useFixture(fixtures.MonkeyPatch("os.path.exists", + lambda path: path in exist_files)) self.useFixture(fixtures.FakePopen(lambda proc_args: { "stdout": StringIO.StringIO( author_new |
