Пример #1
0
 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'))
Пример #2
0
	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'))
Пример #3
0
	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'))
Пример #4
0
 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))
Пример #5
0
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')
Пример #6
0
 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'))
Пример #7
0
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')
Пример #8
0
 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'))
Пример #9
0
	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'))
Пример #10
0
	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'))
Пример #11
0
	def test_perrepo(self):
		self.clone()
		cmdline.run_args(['perrepo', 'ls', '-l'], working_dir=
				os.path.join(self.tempfolder, 'workingcopy'))
Пример #12
0
	def test_version(self):
		with pytest.raises(SystemExit):
			cmdline.run_args(['--version'], os.getcwd())
Пример #13
0
	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))
Пример #14
0
 def test_perrepo(self):
     self.clone()
     cmdline.run_args(['perrepo', 'ls', '-l'],
                      working_dir=os.path.join(self.tempfolder,
                                               'workingcopy'))
Пример #15
0
 def test_version(self):
     with pytest.raises(SystemExit):
         cmdline.run_args(['--version'], os.getcwd())
Пример #16
0
 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'))