'Add a single file to a TorrentDef and save the latter'

def test_add_content_file_save(self):

    t = TorrentDef()
    fn = os.path.join(TESTS_DATA_DIR, self.VIDEO_FILE_NAME)
    t.add_content(fn)
    t.set_tracker(TRACKER)
    t.finalize()
    tfn = os.path.join(os.getcwd(), 'gen.torrent')
    t.save(tfn)
    f = open(tfn, 'rb')
    bdata = f.read()
    f.close()
    os.remove(tfn)
    data = bdecode(bdata)
    metainfo = t.get_metainfo()
    self.general_check(metainfo)
    self.assertEqual(metainfo, data)
