Exemple #1
0
	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
Exemple #2
0
	def test_2(self):
		_copy(self.foo)
		_commit()
		_copy(self.foo_mod)
		_command('push')
		_copy(self.bar)
		_commit()
		_command('pop')
		
		assert len(cmds.svn_changes(CLIENT_DIR)) == 3
Exemple #3
0
	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
Exemple #4
0
	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
Exemple #5
0
	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
Exemple #6
0
	def test_2(self):
		#binary with text
		_copy(self.hi)
		_copy(self.file)
		
		files = ('hi.jpg', self.file)
		
		_command('push')
		
		s = svnstash.Stashes()[0]
		
		fs = s.get_affected_files()
		assert len(fs) == len(files)
		for f in fs:
			assert f in files
		
		_command('pop')
		
		fs = cmds.svn_changes(CLIENT_DIR)
		assert len(fs) == len(files)
		for f in fs:
			assert os.path.basename(f[1]) in files