示例#1
0
    def test_run_invalid_option(self, capsys):
        instance = swf.SWF()
        instance.set_commandline(["invalid"])

        instance.run()
        out, err = capsys.readouterr()
        assert re.search(r".*unrecognized arguments:.*", out)
示例#2
0
    def test_run_short_help(self, capsys):
        instance = swf.SWF()
        instance.set_commandline(["-h"])

        instance.run()
        out, err = capsys.readouterr()
        assert re.search(r"^usage:.*", out)
示例#3
0
    def test_meta(self, capsys, filename):
        __sessions__.new(os.path.join(FIXTURE_DIR, filename))
        instance = swf.SWF()
        instance.command_line = []

        instance.run()
        out, err = capsys.readouterr()

        assert re.search(
            r".*The opened file doesn't appear to be compressed.*", out)
示例#4
0
 def test_args_exception(self):
     instance = swf.SWF()
     with pytest.raises(ArgumentErrorCallback) as excinfo:
         instance.parser.parse_args(["-h"])
     excinfo.match(r".*Parse, analyze and decompress Flash objects.*")
示例#5
0
 def test_init(self):
     instance = swf.SWF()
     assert isinstance(instance, swf.SWF)
     assert isinstance(instance, Module)