def test_run_invalid_option(self, capsys): instance = emailparse.EmailParse() instance.set_commandline(["invalid"]) instance.run() out, err = capsys.readouterr() assert re.search(r".*unrecognized arguments:.*", out)
def test_run_short_help(self, capsys): instance = emailparse.EmailParse() instance.set_commandline(["-h"]) instance.run() out, err = capsys.readouterr() assert re.search(r"^usage:.*", out)
def test_all(self, capsys, filename, expected): __sessions__.new(os.path.join(FIXTURE_DIR, filename)) instance = emailparse.EmailParse() instance.command_line = ['-a'] instance.run() out, err = capsys.readouterr() for e in expected: assert re.search(e, out)
def test_args_exception(self): instance = emailparse.EmailParse() with pytest.raises(ArgumentErrorCallback) as excinfo: instance.parser.parse_args(["-h"]) excinfo.match(r".*Parse eml and msg email files.*")
def test_init(self): instance = emailparse.EmailParse() assert isinstance(instance, emailparse.EmailParse) assert isinstance(instance, Module)