Example #1
0
    def test__git_source_checkout_with_path_argument(self):
        checkout_path = "/some/path/to/checkout"
        git.clone_to_or_update(url=self.repo_url, path=checkout_path, branch=self.branch)
        git.reset_submodules(checkout_path)

        with self.forge.verified_replay_context():
            result = self.source.checkout(self.env, checkout_path)
        self.assertIs(result, checkout_path)
Example #2
0
 def test__git_source_checkout_no_path_argument(self):
     checkout_path = "/some/path/to/checkout"
     checkout_cache = self.forge.create_mock(CheckoutCache)
     self.env.get_checkout_cache().and_return(checkout_cache)
     checkout_cache.get_checkout_path(self.repo_url).and_return(checkout_path)
     git.clone_to_or_update(url=self.repo_url, branch=self.branch, path=checkout_path)
     git.reset_submodules(checkout_path)
     with self.forge.verified_replay_context():
         result = self.source.checkout(self.env)
     self.assertIs(result, checkout_path)
Example #3
0
 def test__clone_or_update_path_does_not_exist(self):
     git.clone_to(self.url, self.branch, self.path)
     with self.forge.verified_replay_context():
         git.clone_to_or_update(self.url, self.branch, self.path)
Example #4
0
 def test__clone_or_update_path_exists(self):
     path = tempfile.gettempdir()
     git.update(self.url, self.branch, path)
     with self.forge.verified_replay_context():
         git.clone_to_or_update(self.url, self.branch, path)