[GRASS-SVN] r66674 - in grass/trunk/temporal: t.rast.univar/testsuite t.rast3d.univar/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 30 06:14:31 PDT 2015


Author: huhabla
Date: 2015-10-30 06:14:31 -0700 (Fri, 30 Oct 2015)
New Revision: 66674

Modified:
   grass/trunk/temporal/t.rast.univar/testsuite/test_univar.py
   grass/trunk/temporal/t.rast3d.univar/testsuite/test_univar.py
Log:
temporal modules: Fixed univar tests to ingore the map id (the id includes the mapset name)


Modified: grass/trunk/temporal/t.rast.univar/testsuite/test_univar.py
===================================================================
--- grass/trunk/temporal/t.rast.univar/testsuite/test_univar.py	2015-10-30 11:32:13 UTC (rev 66673)
+++ grass/trunk/temporal/t.rast.univar/testsuite/test_univar.py	2015-10-30 13:14:31 UTC (rev 66674)
@@ -54,7 +54,11 @@
 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
 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
 """
-        self.assertLooksLike(univar_text,  t_rast_univar.outputs.stdout)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_2(self):
 
@@ -69,7 +73,11 @@
 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
 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
 """
-        self.assertLooksLike(univar_text,  t_rast_univar.outputs.stdout)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_3(self):
 
@@ -84,7 +92,11 @@
 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
 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
 """
-        self.assertLooksLike(univar_text,  t_rast_univar.outputs.stdout)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_4(self):
 
@@ -101,7 +113,11 @@
 """
         univar_output = open("univar_output.txt", "r").read()
 
-        self.assertLooksLike(univar_text, univar_output)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_5(self):
 
@@ -117,7 +133,11 @@
 """
         univar_output = open("univar_output.txt", "r").read()
 
-        self.assertLooksLike(univar_text, univar_output)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_6_error_handling_empty_strds(self):
         # Empty strds

Modified: grass/trunk/temporal/t.rast3d.univar/testsuite/test_univar.py
===================================================================
--- grass/trunk/temporal/t.rast3d.univar/testsuite/test_univar.py	2015-10-30 11:32:13 UTC (rev 66673)
+++ grass/trunk/temporal/t.rast3d.univar/testsuite/test_univar.py	2015-10-30 13:14:31 UTC (rev 66674)
@@ -53,7 +53,11 @@
 a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000
 a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000
 """
-        self.assertLooksLike(univar_text,  t_rast3d_univar.outputs.stdout)
+        for ref, res in zip(univar_text.split("\n"), t_rast3d_univar.outputs.stdout.split("\n")):
+            if ref and res:
+                ref_line = ref.split("|", 1)[1]
+                res_line = res.split("|", 1)[1]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_2(self):
 
@@ -67,7 +71,11 @@
 a_3 at testing|2001-07-01 00:00:00|2001-10-01 00:00:00|300|300|300|300|0|0|0|144000000|0|480000
 a_4 at testing|2001-10-01 00:00:00|2002-01-01 00:00:00|400|400|400|400|0|0|0|192000000|0|480000
 """
-        self.assertLooksLike(univar_text,  t_rast3d_univar.outputs.stdout)
+        for ref, res in zip(univar_text.split("\n"), t_rast3d_univar.outputs.stdout.split("\n")):
+            if ref and res:
+                ref_line = ref.split("|", 1)[1]
+                res_line = res.split("|", 1)[1]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_3(self):
 
@@ -83,7 +91,11 @@
 """
         univar_output = open("univar_output.txt", "r").read()
 
-        self.assertLooksLike(univar_text, univar_output)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_4(self):
 
@@ -98,7 +110,11 @@
 """
         univar_output = open("univar_output.txt", "r").read()
 
-        self.assertLooksLike(univar_text, univar_output)
+        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]
+                self.assertLooksLike(ref_line,  res_line)
 
     def test_5_error_handling_empty_strds(self):
         # Empty str3ds



More information about the grass-commit mailing list