Example #1
0
def test_dump():
    """Unit test for method dump."""
    file_io = FileIO()

    file_io.dump(TEST_SCAN_DIR, tempfile.gettempdir())

    assert is_tarfile(
        os.path.join(
            tempfile.gettempdir(), '.'.join(
                (os.path.basename(file_io.resolve_path_end(TEST_SCAN_DIR)),
                 'pupyl'))))
Example #2
0
def test_bind():
    """Unit test for method bind."""
    file_io = FileIO()

    file_io.dump(TEST_SCAN_DIR, tempfile.gettempdir())

    file_io.bind(
        os.path.join(
            tempfile.gettempdir(), '.'.join(
                (os.path.basename(file_io.resolve_path_end(TEST_SCAN_DIR)),
                 'pupyl'))), os.path.join(tempfile.gettempdir(),
                                          TEST_SCAN_DIR))

    assert os.path.isdir(os.path.join(tempfile.gettempdir(), TEST_SCAN_DIR))