Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,11 @@ def test_bad_file_format(self):
with mock.patch("tszip.cli.exit", side_effect=TestException) as mocked_exit:
with self.assertRaises(TestException):
self.run_tszip([str(self.trees_path)])
mocked_exit.assert_called_once_with(
f"Error loading '{self.trees_path}': File not in kastore format. Either"
f" the file is corrupt or it is not a tskit tree sequence file. It may"
f" be a legacy HDF file upgradable with `tskit upgrade` from tskit "
f"version<0.6.2 or a compressed tree sequence file that can be "
f"decompressed with `tszip`."
)
args = mocked_exit.call_args[0]
self.assertEqual(len(args), 1)
error_message = args[0]
self.assertIn("Error loading", error_message)
self.assertIn("File not in kastore format", error_message)

def test_compress_stdout_keep(self):
self.assertTrue(self.trees_path.exists())
Expand Down
Loading