File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11--------------------
2- [0.2.1] - 2021-01-26
2+ [0.2.2] - 2022-02-22
3+ --------------------
4+
5+ - Support compressing to stdout (aabiddanda, #53, #64)
6+
7+ --------------------
8+ [0.2.1] - 2022-01-26
39--------------------
410
511- Fix for `time_units ` in tskit 0.4.0 (benjeffery, #54, #55)
Original file line number Diff line number Diff line change @@ -312,6 +312,17 @@ def test_compress_stdout_correct(self):
312312 ts = tszip .decompress (str (tmp_file ))
313313 self .assertEqual (ts .tables , self .ts .tables )
314314
315+ def test_compress_stdout_multiple (self ):
316+ self .assertTrue (self .trees_path .exists ())
317+ with mock .patch ("tszip.cli.exit" , side_effect = TestException ) as mocked_exit :
318+ with self .assertRaises (TestException ):
319+ self .run_tszip_stdout (
320+ ["-c" , str (self .trees_path ), str (self .trees_path )]
321+ )
322+ mocked_exit .assert_called_once_with (
323+ "Only one file can be compressed on with '-c'"
324+ )
325+
315326
316327class DecompressSemanticsMixin :
317328 """
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ def run_compress(args):
111111 if args .stdout :
112112 args .keep = True
113113 setup_logging (args )
114+ if args .stdout and len (args .files ) > 1 :
115+ exit ("Only one file can be compressed on with '-c'" )
114116 for file_arg in args .files :
115117 logger .info (f"Compressing { file_arg } " )
116118 try :
You can’t perform that action at this time.
0 commit comments