[GRASS-SVN] r74497 - grass/trunk/temporal/t.rast.univar/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu May 16 09:03:18 PDT 2019
Author: annakrat
Date: 2019-05-16 09:03:18 -0700 (Thu, 16 May 2019)
New Revision: 74497
Modified:
grass/trunk/temporal/t.rast.univar/testsuite/test_t_rast_univar.py
Log:
t.rast.univar: fix tests
Modified: grass/trunk/temporal/t.rast.univar/testsuite/test_t_rast_univar.py
===================================================================
--- grass/trunk/temporal/t.rast.univar/testsuite/test_t_rast_univar.py 2019-05-16 15:39:41 UTC (rev 74496)
+++ grass/trunk/temporal/t.rast.univar/testsuite/test_t_rast_univar.py 2019-05-16 16:03:18 UTC (rev 74497)
@@ -48,13 +48,13 @@
self.runModule("g.region", res=1)
self.assertModule(t_rast_univar)
- univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
+ univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
a_1 at testing|2001-01-01 00:00:00|2001-04-01 00:00:00|100|100|100|100|0|0|0|960000|0|9600|9600
a_2 at testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600
a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600
a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600
"""
- for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.encode('utf8').split("\n")):
+ for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")):
if ref and res:
ref_line = ref.split("|", 1)[1]
res_line = res.split("|", 1)[1]
@@ -68,12 +68,12 @@
self.runModule("g.region", res=1)
self.assertModule(t_rast_univar)
- univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
+ univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
a_2 at testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600
a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600
a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600
"""
- for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.encode('utf8').split("\n")):
+ for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")):
if ref and res:
ref_line = ref.split("|", 1)[1]
res_line = res.split("|", 1)[1]
@@ -87,12 +87,12 @@
self.runModule("g.region", res=10)
self.assertModule(t_rast_univar)
- univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
+ univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
a_2 at testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|19200|0|96|96
a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|28800|0|96|96
a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|38400|0|96|96
"""
- for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.encode('utf8').split("\n")):
+ for ref, res in zip(univar_text.split("\n"), t_rast_univar.outputs.stdout.split("\n")):
if ref and res:
ref_line = ref.split("|", 1)[1]
res_line = res.split("|", 1)[1]
@@ -106,7 +106,7 @@
where="start_time >= '2001-03-01'",
overwrite=True, verbose=True)
- univar_text="""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
+ univar_text=u"""id|start|end|mean|min|max|mean_of_abs|stddev|variance|coeff_var|sum|null_cells|cells|non_null_cells
a_2 at testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600
a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600
a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600
@@ -113,10 +113,12 @@
"""
univar_output = open("univar_output.txt", "r").read()
- for ref, res in zip(univar_text.split("\n"), univar_output.encode('utf8').split("\n")):
+ for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")):
if ref and res:
ref_line = ref.split("|", 1)[1]
res_line = res.split("|", 1)[1]
+ print(type(ref_line))
+ print(type(res_line))
self.assertLooksLike(ref_line, res_line)
def test_5(self):
@@ -127,13 +129,13 @@
where="start_time >= '2001-03-01'",
overwrite=True, verbose=True)
- univar_text="""a_2 at testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600
+ univar_text=u"""a_2 at testing|2001-04-01 00:00:00|2001-07-01 00:00:00|200|200|200|200|0|0|0|1920000|0|9600|9600
a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|2880000|0|9600|9600
a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|3840000|0|9600|9600
"""
univar_output = open("univar_output.txt", "r").read()
- for ref, res in zip(univar_text.split("\n"), univar_output.encode('utf8').split("\n")):
+ for ref, res in zip(univar_text.split("\n"), univar_output.split("\n")):
if ref and res:
ref_line = ref.split("|", 1)[1]
res_line = res.split("|", 1)[1]
More information about the grass-commit
mailing list