def test_test_cmd_no_args(self): self.clone() cmdline.run_args(['test'], working_dir=os.path.join(self.tempfolder, 'workingcopy')) assert os.path.exists( os.path.join(self.tempfolder, 'workingcopy', 'test', 'testran'))
def test_clone_with_default(self): cmdline.run_args(['clone', os.path.join(self.tempfolder, 'gitrepos', 'assemblies'), 'testassembly.katipo'], working_dir= os.path.join(self.tempfolder)) assert os.path.exists(os.path.join(self.tempfolder, 'testassembly')) assert os.path.exists(os.path.join(self.tempfolder, 'testassembly', '.katipo'))
def test_test_cmd(self): self.clone() cmdline.run_args(['test', 'touch', 'foo3'], working_dir= os.path.join(self.tempfolder, 'workingcopy')) assert os.path.exists(os.path.join(self.tempfolder, 'workingcopy', 'test', 'foo3')) assert not os.path.exists(os.path.join(self.tempfolder, 'workingcopy', 'notest', 'foo3'))
def clone(self): """Make working copy (used in other tests).""" cmdline.run_args([ 'clone', os.path.join(self.tempfolder, 'gitrepos', 'assemblies'), 'testassembly.katipo', 'workingcopy' ], working_dir=os.path.join(self.tempfolder))
def test_virtualenv_command(monkeypatch): k = mock.Mock() monkeypatch.setattr(cmdline.katipo, 'KatipoRoot', k) cmdline.run_args(['virtualenv']) k.return_value.setup_virtualenv.assert_called_with(python_exe=None) cmdline.run_args(['virtualenv', '--python', 'python27']) k.return_value.setup_virtualenv.assert_called_with(python_exe='python27')
def test_test_cmd(self): self.clone() cmdline.run_args(['test', 'touch', 'foo3'], working_dir=os.path.join(self.tempfolder, 'workingcopy')) assert os.path.exists( os.path.join(self.tempfolder, 'workingcopy', 'test', 'foo3')) assert not os.path.exists( os.path.join(self.tempfolder, 'workingcopy', 'notest', 'foo3'))
def test_virtualenv_command(monkeypatch): k = mock.Mock() monkeypatch.setattr(cmdline.katipo, 'KatipoRoot', k) cmdline.run_args(['virtualenv']) k.return_value.setup_virtualenv.assert_called_with( python_exe=None) cmdline.run_args(['virtualenv', '--python', 'python27']) k.return_value.setup_virtualenv.assert_called_with( python_exe='python27')
def test_clone_with_default(self): cmdline.run_args([ 'clone', os.path.join(self.tempfolder, 'gitrepos', 'assemblies'), 'testassembly.katipo' ], working_dir=os.path.join(self.tempfolder)) assert os.path.exists(os.path.join(self.tempfolder, 'testassembly')) assert os.path.exists( os.path.join(self.tempfolder, 'testassembly', '.katipo'))
def test_checkout(self): self.clone() cmdline.run_args(['checkout', '-t', 'origin/test-branch'], os.path.join(self.tempfolder, 'workingcopy')) assert os.path.exists(os.path.join(self.tempfolder, 'workingcopy', 'test', 'testfoo'))
def test_test_cmd_no_args(self): self.clone() cmdline.run_args(['test'], working_dir= os.path.join(self.tempfolder, 'workingcopy')) assert os.path.exists(os.path.join(self.tempfolder, 'workingcopy', 'test', 'testran'))
def test_perrepo(self): self.clone() cmdline.run_args(['perrepo', 'ls', '-l'], working_dir= os.path.join(self.tempfolder, 'workingcopy'))
def test_version(self): with pytest.raises(SystemExit): cmdline.run_args(['--version'], os.getcwd())
def clone(self): """Make working copy (used in other tests).""" cmdline.run_args(['clone', os.path.join(self.tempfolder, 'gitrepos', 'assemblies'), 'testassembly.katipo', 'workingcopy'], working_dir= os.path.join(self.tempfolder))
def test_perrepo(self): self.clone() cmdline.run_args(['perrepo', 'ls', '-l'], working_dir=os.path.join(self.tempfolder, 'workingcopy'))
def test_checkout(self): self.clone() cmdline.run_args(['checkout', '-t', 'origin/test-branch'], os.path.join(self.tempfolder, 'workingcopy')) assert os.path.exists( os.path.join(self.tempfolder, 'workingcopy', 'test', 'testfoo'))