示例#1
0
文件: test_client.py 项目: srm4/pyxs
def test_ls(backend):
    c = Client(connection=backend())
    c.mkdir(b"/foo/bar")

    # a) OK-case.
    assert c.ls(b"/foo") == [b"bar"]
    assert c.ls(b"/foo/bar") == []

    # b) directory doesn't exist.
    try:
        c.ls(b"/path/to/something")
    except PyXSError as e:
        assert e.args[0] == errno.ENOENT
示例#2
0
文件: tests.py 项目: brkt/pyxs
def test_ls():
    for backend in [UnixSocketConnection, XenBusConnection]:
        c = Client(connection=backend())
        c.mkdir("/foo/bar")

        # a) OK-case.
        assert c.ls("/foo") == ["bar"]
        assert c.ls("/foo/bar") == []

        # b) directory doesn't exist.
        try:
            c.ls("/path/to/something")
        except PyXSError as e:
            assert e.args[0] is errno.ENOENT
示例#3
0
文件: tests.py 项目: royjenkins/pyxs
def test_ls():
    for backend in [UnixSocketConnection, XenBusConnection]:
        c = Client(connection=backend())
        c.mkdir("/foo/bar")

        # a) OK-case.
        assert c.ls("/foo") == ["bar"]
        assert c.ls("/foo/bar") == []

        # b) directory doesn't exist.
        try:
            c.ls("/path/to/something")
        except PyXSError as e:
            assert e.args[0] is errno.ENOENT
示例#4
0
文件: tests.py 项目: brkt/pyxs
def test_mkdir():
    for backend in [UnixSocketConnection, XenBusConnection]:
        c = Client(connection=backend())

        c.mkdir("/foo/bar")
        assert c.ls("/foo") == ["bar"]
        assert c.read("/foo/bar") == ""
示例#5
0
文件: tests.py 项目: royjenkins/pyxs
def test_mkdir():
    for backend in [UnixSocketConnection, XenBusConnection]:
        c = Client(connection=backend())

        c.mkdir("/foo/bar")
        assert c.ls("/foo") == ["bar"]
        assert c.read("/foo/bar") == ""
示例#6
0
文件: test_client.py 项目: srm4/pyxs
def test_is_domain_introduced(backend):
    c = Client(connection=backend())

    for domid in map(int, c.ls("/local/domain")):
        assert c.is_domain_introduced(domid)

    assert not c.is_domain_introduced(999)
示例#7
0
文件: tests.py 项目: brkt/pyxs
def test_is_domain_introduced():
    for backend in [UnixSocketConnection, XenBusConnection]:
        c = Client(connection=backend())

        for domid in map(int, c.ls("/local/domain")):
            assert c.is_domain_introduced(domid)

        assert not c.is_domain_introduced(999)
示例#8
0
文件: tests.py 项目: royjenkins/pyxs
def test_is_domain_introduced():
    for backend in [UnixSocketConnection, XenBusConnection]:
        c = Client(connection=backend())

        for domid in map(int, c.ls("/local/domain")):
           assert c.is_domain_introduced(domid)

        assert not c.is_domain_introduced(999)
示例#9
0
文件: test_client.py 项目: srm4/pyxs
def test_mkdir(backend):
    c = Client(connection=backend())

    c.mkdir(b"/foo/bar")
    assert c.ls(b"/foo") == [b"bar"]
    assert c.read(b"/foo/bar") == b""