summaryrefslogtreecommitdiffstats
path: root/tests/test_git_superproject.py
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-02-01 11:15:16 -0800
committerRaman Tenneti <rtenneti@google.com>2021-02-01 12:24:51 -0800
commit7caa3658b2d9c7f8d48d8c659a39bb412037f74f (patch)
tree0ebc3aba17548389f23c57d9c3d846d2338b20f2 /tests/test_git_superproject.py
parent9e7875315f8d49a8a58a1b22c5750a11b90ca751 (diff)
downloadgit-repo-7caa3658b2d9c7f8d48d8c659a39bb412037f74f.tar.gz
sync: Do a git pull with --use-superproject if superproject tree already exists.
Tested the code with the following commands. $ ./run_tests -v tests/test_git_superproject.py $ ./run_tests -v Tested the sync code by copying all the repo changes into my Android AOSP checkout and doing a repo sync --use-superproject twice. .../WORKING_DIRECTORY$ repo sync --use-superproject Bug: https://crbug.com/gerrit/13709 Bug: https://crbug.com/gerrit/13707 Tested-by: Raman Tenneti <rtenneti@google.com> Change-Id: I7e4b1e51ca1d18b836a5fa8d139a0765262ba500
Diffstat (limited to 'tests/test_git_superproject.py')
-rw-r--r--tests/test_git_superproject.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py
index 67a75a17..4012ec26 100644
--- a/tests/test_git_superproject.py
+++ b/tests/test_git_superproject.py
@@ -61,6 +61,13 @@ class SuperprojectTestCase(unittest.TestCase):
61 with mock.patch.object(self._superproject, '_Clone', return_value=False): 61 with mock.patch.object(self._superproject, '_Clone', return_value=False):
62 self._superproject.GetAllProjectsSHAs(url='localhost') 62 self._superproject.GetAllProjectsSHAs(url='localhost')
63 63
64 def test_superproject_get_project_shas_mock_pull(self):
65 """Test with _Pull failing."""
66 with self.assertRaises(GitError):
67 with mock.patch.object(self._superproject, '_Clone', return_value=True):
68 with mock.patch.object(self._superproject, '_Pull', return_value=False):
69 self._superproject.GetAllProjectsSHAs(url='localhost')
70
64 def test_superproject_get_project_shas_mock_ls_tree(self): 71 def test_superproject_get_project_shas_mock_ls_tree(self):
65 """Test with LsTree being a mock.""" 72 """Test with LsTree being a mock."""
66 data = ('120000 blob 158258bdf146f159218e2b90f8b699c4d85b5804\tAndroid.bp\x00' 73 data = ('120000 blob 158258bdf146f159218e2b90f8b699c4d85b5804\tAndroid.bp\x00'