def test_write_sparse_dataset(self, tmp_path): writers.write_dataset(tmp_path, self.ds, outcome_label_order=None, fixed_column_mode=True) self.assertFilesEquivalent(tmp_path, self.reference_path('sparse_dataset1a.txt')) writers.write_dataset(tmp_path, self.ds, outcome_label_order=None, fixed_column_mode=False) self.assertFilesEquivalent(tmp_path, self.reference_path('sparse_dataset2a.txt'))
def test_write_sparse_dataset_ordered(self, tmp_path): ordering = io_gen.ordering writers.write_dataset(tmp_path, self.ds, outcome_label_order=ordering, fixed_column_mode=True) self.assertFilesEquivalent(tmp_path, self.reference_path('sparse_dataset1b.txt')) writers.write_dataset(tmp_path, self.ds, outcome_label_order=ordering, fixed_column_mode=False) self.assertFilesEquivalent(tmp_path, self.reference_path('sparse_dataset2b.txt'))
def test_write_dataset_raises_on_bad_type(self, tmp_path): with self.assertRaises(ValueError): writers.write_dataset(tmp_path, self.ds, [('Gx', )])
def test_write_dataset(self, tmp_path): writers.write_dataset(tmp_path, self.ds) self.assertFilesEquivalent( tmp_path, self.reference_path('dataset_loadwrite.txt'))