コード例 #1
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_1_file_mod(self):
		_copy(self.file)
		_command('push')
		_copy(self.file_changed, self.file)
		_commit()
		
		assert not cmds.svn_changes_exist(CLIENT_DIR)
		
		_command('pop')
		
		assert cmds.svn_changes_exist(CLIENT_DIR)
コード例 #2
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_1(self):
		_copy(self.foo)
		_command('push')
		
		ss = svnstash.Stashes()
		
		assert len(ss) == 1
		
		s = ss[0]
		
		assert len(s.get_affected_files()) == 2 #directory doesn't count
		assert not cmds.svn_changes_exist(CLIENT_DIR)
		
		_command('pop')
		
		assert cmds.svn_changes_exist(CLIENT_DIR)
		assert len(cmds.svn_changes(CLIENT_DIR)) == 3
コード例 #3
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_2_apply(self):
		_copy(self.file)
		_command('push')
		
		assert not cmds.svn_changes_exist(CLIENT_DIR)
		
		_command('apply', '0')
		
		assert cmds.svn_changes_exist(CLIENT_DIR)
		
		assert_raises(SystemExit, _command, 'apply', '1')
		
		_command('push')
		_command('apply')
		
		stashes = svnstash.Stashes()
		assert len(stashes) == 2
コード例 #4
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_0_single_file(self):
		_copy(self.file)
		cmds.svn_add(_client_file(self.file))
		
		_command('push')
		assert not cmds.svn_changes_exist(CLIENT_DIR)
		
		stashes = svnstash.Stashes()
		
		assert len(stashes) == 1
		
		s = stashes[0]
		
		assert s.comment == ''
		assert len(s.get_affected_files()) == 1
		
		_command('pop')
		
		assert cmds.svn_changes_exist(CLIENT_DIR)
		assert len(cmds.svn_changes(CLIENT_DIR)) == 1
コード例 #5
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_1(self):
		_copy(self.file)
		_commit()
		_mv(self.file, self.file_moved)
		
		fs = cmds.svn_changes(CLIENT_DIR)
		assert len(fs) == 2
		
		_command('push')
		
		assert not cmds.svn_changes_exist(CLIENT_DIR)
		
		_command('pop')
		
		fs = cmds.svn_changes(CLIENT_DIR)
		assert len(fs) == 1
		assert os.path.basename(fs[0][0]) == svnstash.STATUS.DELETED
		assert os.path.basename(fs[0][1]) == self.file
コード例 #6
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_2(self):
		_copy(self.file)
		_commit()
		_mv(self.file, self.file_moved)
		
		#modify the copied file...still doesn't work :(
		_copy(self.file_mod, self.file_moved)
		
		fs = cmds.svn_changes(CLIENT_DIR)
		assert len(fs) == 2
		
		_command('push')
		
		print _command('show', '0')[0]
		
		assert not cmds.svn_changes_exist(CLIENT_DIR)
		
		_command('pop')
		
		fs = cmds.svn_changes(CLIENT_DIR)
		assert len(fs) == 1
		assert os.path.basename(fs[0][0]) == svnstash.STATUS.DELETED
		assert os.path.basename(fs[0][1]) == self.file
コード例 #7
0
ファイル: test.py プロジェクト: thatguystone/svnstash
	def test_pop(self):
		#Make sure nothing can be popped
		assert_raises(SystemExit, _command, 'pop')
		assert not cmds.svn_changes_exist(CLIENT_DIR)