Esempio n. 1
0
 def setUp(self):
     sleep(5)
     self.token = GitBase._get_token()
     self.reponame = "testpygithub"
     self.github = GitBase._login(self.token)
     self.user = GitBase._get_user(self.github)
     sleep(1)
     self.repo = GitRepoHelper._create_repo(self.user,
                                            self.reponame,
                                            auto_init=True)
     sleep(1)
Esempio n. 2
0
    def setUp(self):
        super(Test_GitHistory,self).setUp()
        self.filename = "uupyshell.txt"
        self.encoding = "uu"
        self.user = GitBase._get_user(self.github)
        self.repo = GitRepoHelper._create_repo(self.user,self.reponame,auto_init=True)        
        write_text_to_file(self.filename,"token:"+encode(self.token,self.encoding) + "\n")
        append_text_to_file(self.filename,"reponame:"+encode(self.reponame,self.encoding) + "\n")
        append_text_to_file(self.filename,"gitrootpath:"+encode(self.gitrootpath,self.encoding) + "\n")
        append_text_to_file(self.filename,"commit_message:"+encode(self.commit_message,self.encoding) + "\n")
        append_text_to_file(self.filename,"commit_files:"+"$$".join([encode(_file,self.encoding) for _file in self.commit_files]) + "\n")

        GitCommitHelper.commit(self.token,self.reponame,self.commit_files,self.commit_message)
Esempio n. 3
0
 def setUp(self):
     super(Test_GitCommit2Levels,self).setUp()
     
     self.commit_files = self.commit_files + ["C:\\Users\\burtnolej\\testpygithub\\test\\git_test5.txt",
                                              "C:\\Users\\burtnolej\\testpygithub\\test\\git_test6.txt"]
     self.filename = "uupyshell.txt"
     self.encoding = "uu"
     self.user = GitBase._get_user(self.github)
     self.repo = GitRepoHelper._create_repo(self.user,self.reponame,auto_init=True)        
     write_text_to_file(self.filename,"token:"+encode(self.token,self.encoding) + "\n")
     append_text_to_file(self.filename,"reponame:"+encode(self.reponame,self.encoding) + "\n")
     append_text_to_file(self.filename,"gitrootpath:"+encode(self.gitrootpath,self.encoding) + "\n")
     append_text_to_file(self.filename,"commit_message:"+encode(self.commit_message,self.encoding) + "\n")
     append_text_to_file(self.filename,"commit_files:"+"$$".join([encode(_file,self.encoding) for _file in self.commit_files]) + "\n")
Esempio n. 4
0
    def setUp(self):
        self.token = GitBase._get_token()
        self.reponame = "testpygithub"
        self.github = GitBase._login(self.token)
        self.user = GitBase._get_user(self.github)
        self.repo = GitRepoHelper._create_repo(self.user,
                                               self.reponame,
                                               auto_init=True)

        self.filenames = [
            environ["MYHOME"] + "\\testpygithub\\git_test.txt",
            environ["MYHOME"] + "\\testpygithub\\git_test2.txt",
            environ["MYHOME"] + "\\testpygithub\\git_test3.txt"
        ]
        self.tree = GitCommitHelper._create_input_tree_multi(
            self.filenames, self.repo)
        self.parents = [GitCommitHelper._get_last_commit(self.repo)]
        self.new_commit = GitCommitHelper._create_commit(
            self.repo, "commit via pyyhon api", self.tree, self.parents)
        self.headref = GitCommitHelper._get_ref(self.repo)
        self.headref.edit(self.new_commit.sha)
Esempio n. 5
0
 def test_(self):
     self.repo = GitRepoHelper._create_repo(self.user, self.reponame)
     self.assertIsInstance(self.repo, Repository.Repository)