示例#1
0
文件: test_helpers.py 项目: srm4/pyxs
def test_validate_watch_path():
    # a) ordinary path should be checked with `validate_path()`
    with pytest.raises(InvalidPath):
        validate_watch_path(b"/foo/")

    with pytest.raises(InvalidPath):
        validate_watch_path(b"/fo\x07o")

    with pytest.raises(InvalidPath):
        validate_watch_path(b"/$/foo")

    # b) special path options are limited to `@introduceDomain` and
    #    `@releaseDomain`.
    with pytest.raises(InvalidPath):
        validate_watch_path(b"@foo")

    # c) OK-case.
    validate_watch_path(b"@introduceDomain")
    validate_watch_path(b"@releaseDomain")
示例#2
0
文件: tests.py 项目: brkt/pyxs
def test_validate_watch_path():
    # a) ordinary path should be checked with `validate_path()`
    with pytest.raises(InvalidPath):
        validate_watch_path("/foo/")

    with pytest.raises(InvalidPath):
        validate_watch_path("/fo\x07o")

    with pytest.raises(InvalidPath):
        validate_watch_path("/$/foo")

    # b) special path options are limited to `@introduceDomain` and
    #    `@releaseDomain`.
    with pytest.raises(InvalidPath):
        validate_watch_path("@foo")

    try:
        validate_watch_path("@introduceDomain")
        validate_watch_path("@releaseDomain")
    except InvalidPath as p:
        pytest.fail("{0} is prefectly valid, baby :)".format(p.args))
示例#3
0
文件: tests.py 项目: royjenkins/pyxs
def test_validate_watch_path():
    # a) ordinary path should be checked with `validate_path()`
    with pytest.raises(InvalidPath):
        validate_watch_path("/foo/")

    with pytest.raises(InvalidPath):
        validate_watch_path("/fo\x07o")

    with pytest.raises(InvalidPath):
        validate_watch_path("/$/foo")

    # b) special path options are limited to `@introduceDomain` and
    #    `@releaseDomain`.
    with pytest.raises(InvalidPath):
        validate_watch_path("@foo")

    try:
        validate_watch_path("@introduceDomain")
        validate_watch_path("@releaseDomain")
    except InvalidPath as p:
        pytest.fail("{0} is prefectly valid, baby :)".format(p.args))