Example #1
0
def test_output_same_structure():
    """
    Test output filename with the same directory structure as input filename.
    """
    input_path = 'data/inputs'
    output_path = 'data/outputs'
    input_file = 'data/inputs/south/raster.tif'
    output_file = 'data/outputs/south/raster.tif'

    result = paths.output(input_file, input_path, output_path, change = False)

    assert result == output_file
Example #2
0
def test_output_change_extra_begin():
    """
    Test output filename with the extra name in the beginning, and changed strutucture.
    """
    input_path = 'data/inputs'
    output_path = 'data/outputs'
    input_file = 'data/inputs/south/raster.tif'
    output_file = 'data/outputs/south_raster.tif'
    extra = 'south_'

    result = paths.output(input_file, input_path, output_path, change = True, extra = extra, begin = True)

    assert result == output_file
Example #3
0
def test_output_same_extension():
    """
    Test output filename with another extension, and the same strutucture.
    """
    input_path = 'data/inputs'
    output_path = 'data/outputs'
    input_file = 'data/inputs/south/raster.tif'
    output_file = 'data/outputs/south/raster.asc'
    extension = '.asc'

    result = paths.output(input_file, input_path, output_path, change = False, output_extension = extension)

    assert result == output_file
Example #4
0
def test_output_same_extra_end():
    """
    Test output filename with the extra name in the ending, and the same strutucture.
    """
    input_path = 'data/inputs'
    output_path = 'data/outputs'
    input_file = 'data/inputs/south/raster.tif'
    output_file = 'data/outputs/south/raster_south.tif'
    extra = '_south'

    result = paths.output(input_file, input_path, output_path, change = False, extra = extra, begin = False)

    assert result == output_file
Example #5
0
def test_output_change_root():
    """
    Test output filename with output path as root path.

    Output filename with a simple directory structure.
    """
    input_path = 'data/inputs'
    output_path = 'data/outputs'
    input_file = 'data/inputs/south/raster.tif'
    output_file = 'data/outputs/raster.tif'

    result = paths.output(input_file, input_path, output_path, change = True)

    assert result == output_file