def test_export_cdt_jtv(self): """The 'export' command for CDT and Java TreeView formats.""" fnames = ["formats/p2-20_1.cnr", "formats/p2-20_2.cnr"] sample_ids = list(map(core.fbase, fnames)) nrows = linecount(fnames[0]) - 1 for fmt_key, header2 in (('cdt', 2), ('jtv', 0)): table = export.merge_samples(fnames) formatter = export.EXPORT_FORMATS[fmt_key] _oh, outrows = formatter(sample_ids, table) self.assertEqual(len(list(outrows)), nrows + header2)