def test_suffix(self): parser = cli.tszip_cli_parser() infile = "tmp.trees" args = parser.parse_args([infile, "-S", ".XYZ"]) self.assertEqual(args.suffix, ".XYZ") args = parser.parse_args([infile, "--suffix=abx"]) self.assertEqual(args.suffix, "abx")
def test_decompress(self): parser = cli.tszip_cli_parser() infile = "tmp.trees.tsz" args = parser.parse_args([infile, "-d"]) self.assertTrue(args.decompress) args = parser.parse_args([infile, "--decompress"]) self.assertTrue(args.decompress)
def test_very_verbose(self): parser = cli.tszip_cli_parser() args = parser.parse_args(["afile", "-vv"]) with mock.patch("logging.basicConfig") as mocked_setup: cli.setup_logging(args) mocked_setup.assert_called_once_with(level="DEBUG", format=cli.log_format)
def test_default(self): parser = cli.tszip_cli_parser() args = parser.parse_args(["afile"]) with mock.patch("logging.basicConfig") as mocked_setup: cli.setup_logging(args) mocked_setup.assert_called_once_with(level="WARN", format=cli.log_format)
def test_default_values(self): parser = cli.tszip_cli_parser() infile = "tmp.trees" args = parser.parse_args([infile]) self.assertEqual(args.files, [infile]) self.assertEqual(args.keep, False) self.assertEqual(args.force, False) self.assertEqual(args.decompress, False) self.assertEqual(args.list, False) self.assertEqual(args.variants_only, False) self.assertEqual(args.suffix, ".tsz")
def test_many_files(self): parser = cli.tszip_cli_parser() infiles = [f"{j}.trees" for j in range(1025)] args = parser.parse_args(infiles) self.assertEqual(args.files, infiles)