'Test adding of files'

def test_file_add(self):

    book = get_simple_book()
    c = get_container(book)
    name = u'folder/added    file.html'
    c.add_file(name, 'xxx')
    self.assertEqual(u'xxx', c.raw_data(name))
    self.assertIn(name, set(c.manifest_id_map.itervalues()))
    self.assertIn(name, {x[0] for x in c.spine_names})
    name = u'added.css'
    c.add_file(name, 'xxx')
    self.assertEqual(u'xxx', c.raw_data(name))
    self.assertIn(name, set(c.manifest_id_map.itervalues()))
    self.assertNotIn(name, {x[0] for x in c.spine_names})
    self.assertEqual(c.make_name_unique(name), u'added-1.css')
    c.add_file(u'added-1.css', 'xxx')
    self.assertEqual(c.make_name_unique(name.upper()), u'added-2.css'.upper())
    self.check_links(c)
