def test_hide(self):
     assert parse_args(split("foo")).hide == []
     assert parse_args(split("foo -H parse_info -H sequence_header -S")).hide == [
         "parse_info",
         "sequence_header",
         "slice",
     ]
 def test_invalid_arguments(self, capsys, args, message_pattern):
     with pytest.raises(SystemExit):
         parse_args(split(args))
     out, err = capsys.readouterr()
     assert re.match(message_pattern, err.split("\n")[-2]) is not None
 def test_show(self):
     assert parse_args(split("foo")).show == []
     assert parse_args(split("foo -s parse_info -s sequence_header")).show == [
         "parse_info",
         "sequence_header",
     ]
 def test_num_trailing_bits(self):
     assert parse_args(split("foo")).num_trailing_bits == 128
     assert parse_args(split("foo -b 1234")).num_trailing_bits == 1234
 def test_from_and_to_offset(self, args, exp_from, exp_to):
     args = parse_args(split("foo {}".format(args)))
     assert args.from_offset == exp_from
     assert args.to_offset == exp_to
 def test_ignore_parse_info_prefix(self):
     assert parse_args(split("foo")).ignore_parse_info_prefix is False
     assert parse_args(split("foo -p")).ignore_parse_info_prefix is True
 def test_show_internal_state(self):
     assert parse_args(split("foo")).show_internal_state is False
     assert parse_args(split("foo -i")).show_internal_state is True
 def test_verbosity(self):
     assert parse_args(split("foo")).verbose == 0
     assert parse_args(split("foo -v")).verbose == 1
     assert parse_args(split("foo -vv")).verbose == 2
 def test_status_display(self):
     assert parse_args(split("foo")).no_status is False
     assert parse_args(split("foo --no-status")).no_status is True
 def test_filename(self):
     assert parse_args(split("foo/bar.vc2")).bitstream == "foo/bar.vc2"