Пример #1
0
def test_get_root_dir():
    jfs = JFS.JFS()
    root = cli.get_root_dir(jfs)
    assert isinstance(root, JFS.JFSMountPoint)
Пример #2
0
WIN32 = (sys.platform == "win32")

TESTFILEDATA=u"""
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla est dolor, convallis fermentum sapien in, fringilla congue ligula. Fusce at justo ac felis vulputate laoreet vel at metus. Aenean justo lacus, porttitor dignissim imperdiet a, elementum cursus ligula. Vivamus eu est viverra, pretium arcu eget, imperdiet eros. Curabitur in bibendum."""

EPOCH = datetime(1970, 1, 1)

def timestamp():
    """
    :return: now in unix time, eg. seconds since 1970
    """
    return (datetime.utcnow() - EPOCH).total_seconds()

jfs = JFS.JFS()
dev = cli.get_jfs_device(jfs)
root = cli.get_root_dir(jfs)

def test_get_jotta_device():
    assert isinstance(dev, JFS.JFSDevice)
    assert dev.name == 'Jotta'

def test_get_root_dir():
    assert isinstance(root, JFS.JFSMountPoint)

def test_ls():
    assert cli.ls([])
    assert cli.ls(['--all'])
    assert cli.ls(['--humanize'])
    assert cli.ls(['--loglevel', 'info'])

def test_mkdir():