def test_http_parser(fname):
    env = treq.load_py(os.path.splitext(fname)[0] + ".py")

    expect = env["request"]
    cfg = env["cfg"]
    req = treq.badrequest(fname)

    with pytest.raises(expect):
        req.check(cfg)
def test_http_parser():
    for fname in glob.glob(os.path.join(reqdir, "*.http")):
        env = treq.load_py(os.path.splitext(fname)[0] + ".py")

        expect = env['request']
        cfg = env['cfg']
        req = treq.badrequest(fname)

        with pytest.raises(expect):
            def f(fname):
                return req.check(cfg)
            f(fname)
def test_http_parser():
    for fname in glob.glob(os.path.join(reqdir, "*.http")):
        env = treq.load_py(os.path.splitext(fname)[0] + ".py")
        expect = env['request']
        cfg = env['cfg']
        req = treq.badrequest(fname)

        @raises(expect)
        def check(fname):
            return req.check(cfg)

        yield check, fname  # fname is pass so that we know which test failed
def test_http_parser():
    for fname in glob.glob(os.path.join(reqdir, "*.http")):
        env = treq.load_py(os.path.splitext(fname)[0] + ".py")
        expect = env['request']
        cfg = env['cfg']
        req = treq.badrequest(fname)

        @raises(expect)
        def check(fname):
            return req.check(cfg)

        yield check, fname # fname is pass so that we know which test failed
def test_http_parser():
    for fname in glob.glob(os.path.join(reqdir, "*.http")):
        env = treq.load_py(os.path.splitext(fname)[0] + ".py")

        expect = env['request']
        cfg = env['cfg']
        req = treq.badrequest(fname)

        with pytest.raises(expect):
            def f(fname):
                return req.check(cfg)
            f(fname)
def test_http_parser():
    for fname in glob.glob(os.path.join(reqdir, "*.http")):
        expect = treq.load_py(os.path.splitext(fname)[0] + ".py")
        req = treq.badrequest(fname, expect)
        yield (req.check,)
Example #7
0
def test_http_parser():
    for fname in glob.glob(os.path.join(reqdir, "*.http")):
        expect = treq.load_py(os.path.splitext(fname)[0] + ".py")
        req = treq.badrequest(fname, expect)
        yield (req.check, )