@@ -21,138 +21,173 @@ def show_messages(self, job_result):
2121
2222 def setUp (self ):
2323 super ().setUp ()
24-
2524 self .maxDiff = None
2625 self .raster_data_dir = TEST_DATA_DIR .joinpath ("raster" )
2726 self .username = "test_username"
2827
29- # All steps are expected to finish with ok status by default.
30- self .expected_step_statuses = ["ok" ] * 13
31-
32- # High resolution forest type (FTY) - 10m
3328 def test_fty_2018_010m (self ):
29+ """High resolution forest type (FTY) - 10m"""
3430 product_ident = "fty_2018_010m"
3531 filepath = self .raster_data_dir .joinpath ("fty_010m" , "FTY_2018_010m_eu_03035_clip.zip" )
32+
33+ expected_step_results = ["ok" ] * 15
3634 # fty_010m has extra checks raster.tile and raster.mmu
37- self .expected_step_statuses = ["ok" ] * 15
38- self .expected_step_statuses [12 ] = "failed"
35+ expected_step_results [12 ] = "failed"
36+ expected_step_results [14 ] = "cancelled"
37+
3938 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
4039 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
41- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
40+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
4241
43- # High resolution forest type (FTY) - 100m
4442 def test_fty_2018_100m (self ):
43+ """High resolution forest type (FTY) - 100m"""
4544 product_ident = "fty_2018_100m"
4645 filepath = self .raster_data_dir .joinpath ("fty_100m" , "fty_2018_100m_eu_03035_d02_clip.zip" )
46+
47+ expected_step_results = ["ok" ] * 13
48+ expected_step_results [12 ] = "cancelled"
49+
4750 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
4851 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
49- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
52+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
5053
51- # High resolution grassland (GRA) - 10m
5254 def test_gra_2018_010m (self ):
55+ """High resolution grassland (GRA) - 10m"""
5356 product_ident = "gra_2018_010m"
5457 filepath = self .raster_data_dir .joinpath ("gra_010m" , "GRA_2018_010m_eu_03035_V1_clip.zip" )
5558
59+ expected_step_results = ["ok" ] * 13
5660 # gra_010m has mismatching attributes and color table
57- self .expected_step_statuses [3 ] = "failed"
58- self .expected_step_statuses [10 ] = "failed"
61+ expected_step_results [3 ] = "failed"
62+ expected_step_results [10 ] = "failed"
63+ expected_step_results [12 ] = "cancelled"
64+
5965 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
6066 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
61- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
67+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
6268
63- # High resolution grassland (GRA) - 100m
6469 def test_gra_2018_100m (self ):
70+ """High resolution grassland (GRA) - 100m"""
6571 product_ident = "gra_2018_100m"
6672 filepath = self .raster_data_dir .joinpath ("gra_100m" , "GRA_2018_100m_eu_03035_V1_clip.zip" )
73+
74+ expected_step_results = ["ok" ] * 13
6775 # gra_2018_100m has mismatching attributes and color table
68- self .expected_step_statuses [3 ] = "failed"
69- self .expected_step_statuses [10 ] = "failed"
76+ expected_step_results [3 ] = "failed"
77+ expected_step_results [10 ] = "failed"
78+ expected_step_results [12 ] = "cancelled"
79+
7080 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
7181 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
72- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
82+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
7383
74- # High resolution imperviousness change (IMC) - 20m
7584 def test_imc_1518_020m (self ):
85+ """High resolution imperviousness change (IMC) - 20m"""
7686 product_ident = "imc_1518_020m"
7787 filepath = self .raster_data_dir .joinpath ("imc_020m" , "IMC_1518_020m_eu_03035_d02_clip.zip" )
7888
89+ expected_step_results = ["ok" ] * 13
7990 # imc_1518_020m has mismatching attributes and color table
80- self .expected_step_statuses [3 ] = "failed"
81- self .expected_step_statuses [10 ] = "failed"
91+ expected_step_results [3 ] = "failed"
92+ expected_step_results [10 ] = "failed"
93+ expected_step_results [12 ] = "cancelled"
94+
8295 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
8396 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
84- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
97+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
8598
86- # High resolution imperviousness change (IMC) - 100m
8799 def test_imc_1518_100m (self ):
100+ """High resolution imperviousness change (IMC) - 100m"""
88101 product_ident = "imc_1518_100m"
89102 filepath = self .raster_data_dir .joinpath ("imc_100m" , "IMC_1518_100m_eu_03035_d02_clip.zip" )
90103
104+ expected_step_results = ["ok" ] * 13
91105 # imc_1518_020m has mismatching attributes, values and color table
92- self .expected_step_statuses [3 ] = "failed"
93- self .expected_step_statuses [9 ] = "failed"
94- self .expected_step_statuses [10 ] = "failed"
106+ expected_step_results [3 ] = "failed"
107+ expected_step_results [9 ] = "failed"
108+ expected_step_results [10 ] = "failed"
109+ expected_step_results [12 ] = "cancelled"
110+
95111 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
96112 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
97- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
113+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
98114
99- # High resolution imperviousness density (IMD) - 10m
100115 def test_imd_2018_010m (self ):
116+ """High resolution imperviousness density (IMD) - 10m"""
101117 product_ident = "imd_2018_010m"
102118 filepath = self .raster_data_dir .joinpath ("imd_010m" , "IMD_2018_010m_eu_03035_d04_clip.zip" )
103119
120+ expected_step_results = ["ok" ] * 13
104121 # imd_2018_010m has mismatching attributes
105- self .expected_step_statuses [3 ] = "failed"
122+ expected_step_results [3 ] = "failed"
123+ expected_step_results [12 ] = "cancelled"
124+
106125 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
107126 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
108- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
127+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
109128
110- # High resolution imperviousness density (IMD) - 100m
111129 def test_imd_2018_100m (self ):
130+ """High resolution imperviousness density (IMD) - 100m"""
112131 product_ident = "imd_2018_100m"
113132 filepath = self .raster_data_dir .joinpath ("imd_100m" , "IMD_2018_100m_eu_03035_d02_clip.zip" )
114133
134+ expected_step_results = ["ok" ] * 13
115135 # imd_2018_100m has mismatching attributes
116- self .expected_step_statuses [3 ] = "failed"
136+ expected_step_results [3 ] = "failed"
137+ expected_step_results [12 ] = "cancelled"
138+
117139 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
118140 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
119- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
141+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
120142
121- # High resolution tree cover density (TCD) - 10m
122143 def test_tcd_2018_010m (self ):
144+ """High resolution tree cover density (TCD) - 10m"""
123145 product_ident = "tcd_2018_010m"
146+ filepath = self .raster_data_dir .joinpath ("tcd_010m" , "TCD_2018_010m_eu_03035_d04_clip.zip" )
124147
148+ expected_step_results = ["ok" ] * 13
125149 # tcd_2018_010m has mismatching colors
126- self .expected_step_statuses [10 ] = "failed"
127- filepath = self .raster_data_dir .joinpath ("tcd_010m" , "TCD_2018_010m_eu_03035_d04_clip.zip" )
150+ expected_step_results [10 ] = "failed"
151+ expected_step_results [12 ] = "cancelled"
152+
128153 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
129154 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
130- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
155+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
131156
132- # High resolution tree cover density (TCD) - 100m
133157 def test_tcd_2018_100m (self ):
158+ """High resolution tree cover density (TCD) - 100m"""
134159 product_ident = "tcd_2018_100m"
135160 filepath = self .raster_data_dir .joinpath ("tcd_100m" , "TCD_2018_100m_eu_03035_d03_clip.zip" )
136161
162+ expected_step_results = ["ok" ] * 13
137163 # tcd_2018_010m has mismatching colors
138- self .expected_step_statuses [10 ] = "failed"
164+ expected_step_results [10 ] = "failed"
165+ expected_step_results [12 ] = "cancelled"
166+
139167 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
140168 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
141- self .assertListEqual (self . expected_step_statuses , step_statuses , self .show_messages (job_result ))
169+ self .assertListEqual (expected_step_results , step_statuses , self .show_messages (job_result ))
142170
143- # High resolution small woody features - 5m raster + vector
144171 def test_swf_2015_100m (self ):
172+ """High resolution small woody features - 5m raster + vector"""
173+ product_ident = "swf_2015_100m"
145174 filepath = TEST_DATA_DIR .joinpath ("raster" , "swf_100m" , "swf_2015_100m_eu_03035_v1_1.zip" )
175+
146176 expected_step_results = ["ok" ] * 11
147- job_result = dispatch (self .job_uuid , "user_name" , filepath , "swf_2015_100m" )
177+ expected_step_results [10 ] = "cancelled"
178+
179+ job_result = dispatch (self .job_uuid , "user_name" , filepath , product_ident )
148180 step_results = [step_result ["status" ] for step_result in job_result ["steps" ]]
149181 self .assertListEqual (expected_step_results , step_results )
150182
151- # General raster product
152183 def test_general_raster (self ):
184+ """General raster product"""
153185 product_ident = "general_raster"
154186 filepath = self .raster_data_dir .joinpath ("general_raster" , "general_raster.zip" )
155- expected_step_statuses = ["ok" ] * 9
187+
188+ expected_step_results = ["ok" ] * 9
189+ expected_step_results [8 ] = "cancelled"
190+
156191 job_result = dispatch (self .job_uuid , self .username , filepath , product_ident )
157192 step_statuses = [step_result ["status" ] for step_result in job_result ["steps" ]]
158- self .assertListEqual (expected_step_statuses , step_statuses )
193+ self .assertListEqual (expected_step_results , step_statuses )
0 commit comments