'Unit test for get_tree_changes delete.'

def test_get_tree_changes_delete(self):

    filename = 'foo'
    fullpath = os.path.join(self.repo.path, filename)
    with open(fullpath, 'w') as f:
        f.write('stuff')
    porcelain.add(repo=self.repo.path, paths=fullpath)
    porcelain.commit(repo=self.repo.path, message='test    status', author='', committer='')
    cwd = os.getcwd()
    try:
        os.chdir(self.repo.path)
        porcelain.remove(repo=self.repo.path, paths=[filename])
    finally:
        os.chdir(cwd)
    changes = porcelain.get_tree_changes(self.repo.path)
    self.assertEqual(changes['delete'][0], filename.encode('ascii'))
    self.assertEqual(len(changes['add']), 0)
    self.assertEqual(len(changes['modify']), 0)
    self.assertEqual(len(changes['delete']), 1)
