Exemplo n.º 1
0
 def main_gist_clone(self, rc=0, args={}):
     assert rc == main(self.setup_args({
         'gist': True,
         'clone': True,
         '--path': self.tempdir.name
     }, args)), "Non {} result for gist clone".format(rc)
     return RepositoryService._current._did_gist_clone
Exemplo n.º 2
0
 def main_open(self, repo=None, rc=0, args={}):
     assert rc == main(self.setup_args({
         'open': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for open".format(rc)
     return RepositoryService._current._did_open
Exemplo n.º 3
0
 def main_noop(self, repo, rc=1, args={}):
     assert rc == main(
         self.setup_args(
             {
                 '<user>/<repo>': repo,
                 '--path': self.tempdir.name
             }, args)), "Non {} result for no-action".format(rc)
Exemplo n.º 4
0
 def main_config(self, target, rc=0, args={}):
     assert rc == main(self.setup_args({
         'config': True,
         '--config': os.path.join(self.tempdir.name, 'gitconfig')
     }, args)), "Non {} result for config".format(rc)
     with open(os.path.join(self.tempdir.name, 'gitconfig')) as f:
         return f.readlines()
Exemplo n.º 5
0
 def main_gist_delete(self, rc=0, args={}):
     assert rc == main(
         self.setup_args({
             'gist': True,
             'delete': True,
         }, args)), "Non {} result for gist delete".format(rc)
     return RepositoryService._current._did_gist_delete
Exemplo n.º 6
0
 def main_gist_clone(self, rc=0, args={}):
     assert rc == main(self.setup_args({
         'gist': True,
         'clone': True,
         '--path': self.tempdir.name
     }, args)), "Non {} result for gist clone".format(rc)
     return RepositoryService._current._did_gist_clone
Exemplo n.º 7
0
 def main_open(self, repo=None, rc=0, args={}):
     assert rc == main(self.setup_args({
         'open': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for open".format(rc)
     return RepositoryService._current._did_open
Exemplo n.º 8
0
 def main_config(self, target, rc=0, args={}):
     assert rc == main(self.setup_args({
         'config': True,
         '--config': os.path.join(self.tempdir.name, 'gitconfig')
     }, args)), "Non {} result for config".format(rc)
     with open(os.path.join(self.tempdir.name, 'gitconfig')) as f:
         return f.readlines()
Exemplo n.º 9
0
 def main_request_create(self, repo=None, rc=0, args={}):
     assert rc == main(self.setup_args({
         'request': True,
         'create': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for request create".format(rc)
     return RepositoryService._current._did_request_create
Exemplo n.º 10
0
 def main_request_create(self, repo=None, rc=0, args={}):
     assert rc == main(self.setup_args({
         'request': True,
         'create': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for request create".format(rc)
     return RepositoryService._current._did_request_create
Exemplo n.º 11
0
 def main_add(self, repo, rc=0, args={}):
     os.mkdir(os.path.join(self.tempdir.name, repo.split('/')[-1]))
     Repo.init(os.path.join(self.tempdir.name, repo.split('/')[-1]))
     assert rc == main(self.setup_args({
         'add': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for add".format(rc)
     return RepositoryService._current._did_add
Exemplo n.º 12
0
 def main_add(self, repo, rc=0, args={}):
     os.mkdir(os.path.join(self.tempdir.name, repo.split('/')[-1]))
     Repo.init(os.path.join(self.tempdir.name, repo.split('/')[-1]))
     assert rc == main(self.setup_args({
         'add': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for add".format(rc)
     return RepositoryService._current._did_add
Exemplo n.º 13
0
 def main_delete(self, repo=None, rc=0, args={}):
     if repo:
         repo_path = os.path.join(self.tempdir.name, repo.split('/')[-1])
         os.mkdir(repo_path)
         Repo.init(repo_path)
     assert rc == main(self.setup_args({
         'delete': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name,
     }, args)), "Non {} result for delete".format(rc)
     return RepositoryService._current._did_delete
Exemplo n.º 14
0
 def main_delete(self, repo=None, rc=0, args={}):
     if repo:
         repo_path = os.path.join(self.tempdir.name, repo.split('/')[-1])
         os.mkdir(repo_path)
         Repo.init(repo_path)
     assert rc == main(self.setup_args({
         'delete': True,
         '<user>/<repo>': repo,
         '--path': self.tempdir.name,
     }, args)), "Non {} result for delete".format(rc)
     return RepositoryService._current._did_delete
Exemplo n.º 15
0
 def main_noop(self, repo, rc=1, args={}):
     assert rc == main(self.setup_args({
         '<user>/<repo>': repo,
         '--path': self.tempdir.name
     }, args)), "Non {} result for no-action".format(rc)
Exemplo n.º 16
0
 def main_gist_delete(self, rc=0, args={}):
     assert rc == main(self.setup_args({
         'gist': True,
         'delete': True,
     }, args)), "Non {} result for gist delete".format(rc)
     return RepositoryService._current._did_gist_delete