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 1
1
--------------------
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
3
9
--------------------
4
10
5
11
- 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):
312
312
ts = tszip .decompress (str (tmp_file ))
313
313
self .assertEqual (ts .tables , self .ts .tables )
314
314
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
+
315
326
316
327
class DecompressSemanticsMixin :
317
328
"""
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ def run_compress(args):
111
111
if args .stdout :
112
112
args .keep = True
113
113
setup_logging (args )
114
+ if args .stdout and len (args .files ) > 1 :
115
+ exit ("Only one file can be compressed on with '-c'" )
114
116
for file_arg in args .files :
115
117
logger .info (f"Compressing { file_arg } " )
116
118
try :
You can’t perform that action at this time.
0 commit comments