Commit 4f85002e authored by Jessica Palka's avatar Jessica Palka
Browse files

Adding comments to the test script.

parent c3ef1935
Pipeline #928 passed with stages
in 45 seconds
......@@ -105,7 +105,7 @@ class Test_GeoarrayAppliedOnPathArray(unittest.TestCase):
cls.L8_2bands_extract10x11 = "".join((tests_path,"/tests/data/L8_2bands_extract10x11.tif"))
cls.testtiff = GeoArray(cls.L8_2bands_extract10x11)
# Serialize the "GeoArray"-class to the "data"-directory
# Serialize the "GeoArray"-class to the "../tests/data/output"-directory
serialized_testtiff_path = "".join((tests_path,"/tests/data/output/testtiff_path.tmp"))
os.makedirs(os.path.dirname(serialized_testtiff_path), exist_ok=True)
with open(serialized_testtiff_path, "wb") as f:
......@@ -126,7 +126,7 @@ class Test_GeoarrayAppliedOnPathArray(unittest.TestCase):
cls.testtiff = GeoArray(cls.L8_2bands_extract10x11, geotransform=cls.given_geotransform,
projection=cls.given_projection, bandnames=cls.given_bandnames)
# Serialize the "GeoArray"-class to the "data"-directory
# Serialize the "GeoArray"-class to the "../tests/data/output"-directory
serialized_testtiff_array = "".join((tests_path, "/tests/data/output/testtiff_array.tmp"))
os.makedirs(os.path.dirname(serialized_testtiff_array), exist_ok=True)
with open(serialized_testtiff_array,"wb") as f:
......@@ -455,7 +455,7 @@ class Test_GeoarrayFunctions(unittest.TestCase):
def test_MetadataIsInstanceOfGeodataframe(self):
# TODO: Create metadata-file.
# TODO: Create a metadata-file for the tested TIFF-Image.
# TODO: Test, if the metadata-function gives an output
"""
Testing the function: metadata.
......@@ -469,19 +469,19 @@ class Test_GeoarrayFunctions(unittest.TestCase):
def test_SaveTiffToDisk(self):
"""
Testing the function: save,
after executing the function and
test with 2 stages.
Stage 1: After saving the original TIFF-Image (output format "GTiff") to the "../tests/data"-directory with
the "save"-function and then instancing the copied TIFF-Image as "GeoArray"-object, it is first
tested, if the file exists in the aforementioned directory. When the file exists,
induction of stage 2...
Stage 1: After saving the original TIFF-Image (output format "GTiff") to the "../tests/data/output"-directory
with the "save"-function and then instancing the copied TIFF-Image as "GeoArray"-object, it is
first tested, if the file exists in the aforementioned directory.
When the file exists, induction of stage 2...
Stage 2: Testing, whether a) the object "testtiff_copy" is an instance of the "GeoArray"-class, and b) if the
numpy.array of the copied TIFF-Image is identical to the numpy.array of the original TIFF-Image.
If the newly created file does not exist in the "data"-directory (Stage 1), the whole test will be skipped.
If the newly created file does not exist in the "../tests/data/output"-directory (Stage 1), the whole test
will be skipped.
"""
# Saving the "GeoArray"-instance "testtiff" with the "save"-function of the "GeoArray"-class to the
# "../tests/data"-directory of this repository and instancing it again as a "GeoArray"-object.
# "../tests/data/output"-directory of this repository and instancing it again as a "GeoArray"-object.
L8_2bands_extract10x11_copy = "".join((tests_path, "/tests/data/output/L8_BadDataMask10x11_copy.tif"))
self.testtiff.save(L8_2bands_extract10x11_copy, fmt="GTiff")
testtiff_copy = GeoArray(L8_2bands_extract10x11_copy)
......@@ -502,9 +502,9 @@ class Test_GeoarrayFunctions(unittest.TestCase):
def test_PlottingFunctions(self):
# FIXME: This test-function is not yet complete! + (TODO: Use other parameters of the plot functions!)
# TODO: Idea: Testing of plot-functions with "from matplotlib.testing.decorators import image_comparison" (?)
# TODO: Example of matplotlib.testing.decorators under: https://github.com/ketch/griddle/blob/master/tests/plot_tests.py
# FIXME: This test-function is not yet complete! + TODO: Use other parameters of the plot functions!
# TODO: Idea: Testing of plot-functions with "from matplotlib.testing.decorators import image_comparison" (?),
# TODO example of matplotlib.testing.decorators under: https://github.com/ketch/griddle/blob/master/tests/plot_tests.py
self.testtiff.show()
# self.testtiff.show(interactive=True) # only works if test is started with ipython.
# self.testtiff.show_map()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment