Пример #1
0
    def test_subcommand_works_in_general(self):
        """Verify that git subcommand works in general."""

        output = gitcli.subcommand(self.repo1,
                                   ['cat-file', 'blob', 'master:file1'])
        self.assertEqual(output.strip(), 'this is file1')

        output = gitcli.subcommand(self.repo2,
                                   ['cat-file', 'blob', 'master:file2'])
        self.assertEqual(output.strip(), 'this is file2')
Пример #2
0
    def test_subcommand_allows_repo_path_to_be_overriden(self):
        """Verify that git subcommand allows the repo path to be overridden."""

        # we pass in repo1 (with file1) but set the cwd to repo2
        output = gitcli.subcommand(self.repo1,
                                   ['cat-file', 'blob', 'master:file2'],
                                   cwd=self.repo2.path)
        self.assertEqual(output.strip(), 'this is file2')