def test_index(self): """Test that `foo.sxd` produces the correct sbx file""" generated_index = process_sxd(base + ".sxd").entries_to_str() with codecs.open(base + ".sbx", "r", "utf-8") as control_index: self.assertEqual( control_index.read(), generated_index, )
def build_sbx(self): """Make index""" LOGGER.info("Building indexes…") sxd_files = glob.glob("%s_*.sxd" % self.basename) for sxd_file in sxd_files: LOGGER.debug("Processing " + sxd_file) idx = process_sxd(sxd_file) with codecs.open(sxd_file[:-3] + "sbx", "w", "utf-8") as index_file: index_file.write(idx.entries_to_str())
def build_sbx(self): """Make .sbx indexes from .sxd files""" LOGGER.info("Building .sbx indexes…") sxd_files = glob.glob("%s_*.sxd" % self.basename) for sxd_file in sxd_files: LOGGER.debug("Processing " + sxd_file) idx = process_sxd(sxd_file) with codecs.open(sxd_file[:-3] + "sbx", "w", "utf-8") as index_file: index_file.write(idx.entries_to_str())
def test_index(self): """Test that `foo.sxd` produces the correct sbx file""" generated_index = process_sxd(base + ".sxd").entries_to_str() with codecs.open(base + ".sbx", "r", "utf-8") as control_index: self.assertEqual(control_index.read(), generated_index, )