def test_find_root(self): """Check that Katipo can find a katipo root after it is created.""" katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy')) # Check that you can find it inside a folder os.mkdir(os.path.join(self.tempfolder, 'workingcopy', 'test', 'foo')) katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy', 'test', 'foo'))
def exec_cmd(self, args, working_dir): external_cmd = args.external_cmd if len(external_cmd) == 0: external_cmd = ['./test'] logging.info('Executing command %s' % str(external_cmd)) k = katipo.KatipoRoot(folder=working_dir) k.run_cmd_per_repo(external_cmd, test_only=True)
def test_clone(self): k = katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy'), giturl=os.path.join(self.tempfolder, 'gitrepos/assemblies'), assemblyfile='testassembly.katipo') # Check that the two repos in the assembly were created properly os.stat(os.path.join(self.tempfolder, 'workingcopy', 'test', 'test')) os.stat(os.path.join(self.tempfolder, 'workingcopy', 'notest', 'notest'))
def test_overclone(self): """Check that trying to clone on top of an existing katipo setup throws an Exception.""" k = katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy'), giturl=os.path.join(self.tempfolder, 'gitrepos/assemblies'), assemblyfile='testassembly.katipo') def _run(): katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy'), giturl=os.path.join(self.tempfolder, 'gitrepos/assemblies'), assemblyfile='testassembly.katipo') self.assertRaises(Exception, _run)
def exec_cmd(self, args, working_dir): clone_location = args.clonelocation if clone_location is None: # Default to cloning in the basename of assembly file clone_location = os.path.splitext(args.assemblyfile)[0] if os.path.isabs(clone_location): working_dir = clone_location else: working_dir = os.path.join(working_dir, clone_location) logging.info('Cloning into working_dir %s' % working_dir) katipo.KatipoRoot(folder=working_dir, giturl=args.assemblyrepo, assemblyfile=args.assemblyfile)
def _run(): katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy'), giturl=os.path.join(self.tempfolder, 'gitrepos/assemblies'), assemblyfile='testassembly.katipo')
def exec_cmd(self, args, working_dir): logging.info('Executing command', args.external_cmd) k = katipo.KatipoRoot(folder=working_dir) k.run_cmd_per_repo(args.external_cmd)
def exec_cmd(self, args, working_dir): k = katipo.KatipoRoot(folder=working_dir) k.setup_virtualenv(python_exe=args.python)
def exec_cmd(self, args, working_dir): k = katipo.KatipoRoot(folder=working_dir) k.checkout(args.branch, tracking=args.tracking)
def checkout_working_copy(self): self.k = katipo.KatipoRoot(folder=os.path.join(self.tempfolder, 'workingcopy'), giturl=os.path.join(self.tempfolder, 'gitrepos/assemblies'), assemblyfile='testassembly.katipo')