aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2023-06-09 19:40:44 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-06-09 19:40:44 +0000
commit9fa50e14d4f65e6ad747c2e1806f5ad33c574905 (patch)
treef5a94a1b63fa66168246667d5f6e2e0fd95f6867
parentf1be36bc9a2d4d2d5916667ea5ea16501b6f65d6 (diff)
parentc18581114435209fae52357d7265c7683e0a2695 (diff)
downloadrepohooks-9fa50e14d4f65e6ad747c2e1806f5ad33c574905.tar.gz
hooks: add missing REPO_PATH tests am: c185811144
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/2620896 Change-Id: Ie76f804b36099554a99894ede2946cd9e4ee6cca Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-xrh/hooks_unittest.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/rh/hooks_unittest.py b/rh/hooks_unittest.py
index 45ad688..4f2103a 100755
--- a/rh/hooks_unittest.py
+++ b/rh/hooks_unittest.py
@@ -179,17 +179,24 @@ class PlaceholderTests(unittest.TestCase):
@mock.patch.object(rh.git, 'find_repo_root')
def testREPO_OUTER_ROOT(self, m):
"""Verify handling of REPO_OUTER_ROOT."""
- m.side_effect=mock_find_repo_root
+ m.side_effect = mock_find_repo_root
self.assertEqual(self.replacer.get('REPO_OUTER_ROOT'),
mock_find_repo_root(path=None, outer=True))
@mock.patch.object(rh.git, 'find_repo_root')
def testREPO_ROOT(self, m):
"""Verify handling of REPO_ROOT."""
- m.side_effect=mock_find_repo_root
+ m.side_effect = mock_find_repo_root
self.assertEqual(self.replacer.get('REPO_ROOT'),
mock_find_repo_root(path=None, outer=False))
+ def testREPO_PATH(self):
+ """Verify handling of REPO_PATH."""
+ os.environ['REPO_PATH'] = ''
+ self.assertEqual(self.replacer.get('REPO_PATH'), '')
+ os.environ['REPO_PATH'] = 'foo/bar'
+ self.assertEqual(self.replacer.get('REPO_PATH'), 'foo/bar')
+
@mock.patch.object(rh.hooks, '_get_build_os_name', return_value='vapier os')
def testBUILD_OS(self, m):
"""Verify handling of BUILD_OS."""