Exemple #1
0
def test_make_file_locator_zip_name(files_in_zip):
    """Test for make_file_locator with zip file name.
    """
    archive = files_in_zip

    loc = ged2doc_input.make_file_locator(archive, "*.ged", None)
    assert isinstance(loc, ged2doc_input._ZipLocator)
    checkFilesLoc(loc)
Exemple #2
0
def test_make_file_locator_name(files_on_disk):
    """Test for make_file_locator with file name.
    """
    tmpdir = files_on_disk

    loc = ged2doc_input.make_file_locator(os.path.join(tmpdir, "xxx.ged"), "", tmpdir)
    assert isinstance(loc, ged2doc_input._FSLocator)
    checkFilesLoc(loc)
Exemple #3
0
def test_make_file_locator_zip_fobj(files_in_zip):
    """Test for make_file_locator with file object.
    """
    archive = files_in_zip

    with open(archive, 'rb') as fobj:
        loc = ged2doc_input.make_file_locator(fobj, "*.ged", None)
        assert isinstance(loc, ged2doc_input._ZipLocator)
        checkFilesLoc(loc)
Exemple #4
0
def test_make_file_locator_fobj(files_on_disk):
    """Test for make_file_locator with file object.
    """
    tmpdir = files_on_disk

    with open(os.path.join(tmpdir, "xxx.ged"), 'rb') as fobj:
        loc = ged2doc_input.make_file_locator(fobj, "", tmpdir)
        assert isinstance(loc, ged2doc_input._FSLocator)
        checkFilesLoc(loc)