'Test removal of files from the container'

def test_file_removal(self):

    book = get_simple_book()
    c = get_container(book, tdir=self.tdir)
    files = (u'toc.ncx', u'cover.png', u'titlepage.xhtml')
    self.assertIn(u'titlepage.xhtml', {x[0] for x in c.spine_names})
    self.assertTrue(c.opf_xpath(u'//opf:meta[@name="cover"]'))
    for x in files:
        c.remove_item(x)
    self.assertIn(c.opf_name, c.dirtied)
    self.assertNotIn(u'titlepage.xhtml', {x[0] for x in c.spine_names})
    self.assertFalse(c.opf_xpath(u'//opf:meta[@name="cover"]'))
    raw = c.serialize_item(c.opf_name).decode(u'utf-8')
    for x in files:
        self.assertNotIn(x, raw)
