From c18581114435209fae52357d7265c7683e0a2695 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 8 Jun 2023 23:02:47 -0400 Subject: hooks: add missing REPO_PATH tests Bug: None Test: unittests Change-Id: Icc368a7f9d47fdbefdbfde400647ff49721201e8 --- rh/hooks_unittest.py | 11 +++++++++-- 1 file 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.""" -- cgit v1.2.3