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
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
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)
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()
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
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
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
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
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)
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