'Basic test of porcelain push, removing a branch.'

def test_delete(self):

    outstream = BytesIO()
    errstream = BytesIO()
    porcelain.commit(repo=self.repo.path, message='init', author='', committer='')
    clone_path = tempfile.mkdtemp()
    self.addCleanup(shutil.rmtree, clone_path)
    target_repo = porcelain.clone(self.repo.path, target=clone_path, errstream=errstream)
    target_repo.close()
    refs_path = 'refs/heads/foo'
    new_id = self.repo['HEAD'].id
    self.assertNotEqual(new_id, ZERO_SHA)
    self.repo.refs[refs_path] = new_id
    porcelain.push(clone_path, self.repo.path, (':' + refs_path), outstream=outstream, errstream=errstream)
    self.assertEqual({'HEAD': new_id, 'refs/heads/master': new_id}, self.repo.get_refs())
