Exemple #1
0
def test_filestore_validate_ota_dir(tmpdir):
    file_prov = ota_p.FileStore()

    assert file_prov.validate_ota_dir(None) is None

    tmpdir = str(tmpdir)
    assert file_prov.validate_ota_dir(tmpdir) == tmpdir

    # non existing dir
    non_existing = os.path.join(tmpdir, "non_existing")
    assert file_prov.validate_ota_dir(non_existing) is None

    # file instead of dir
    file_path = os.path.join(tmpdir, "file")
    with open(file_path, mode="w+"):
        pass
    assert file_prov.validate_ota_dir(file_path) is None
Exemple #2
0
def file_prov():
    p = ota_p.FileStore()
    p.enable()
    return p