airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject incubator-airflow git commit: Fix tests for topological sort
Date Sat, 11 Mar 2017 21:27:09 GMT
Repository: incubator-airflow
Updated Branches:
  refs/heads/master bb39078a3 -> 7a6cd96af


Fix tests for topological sort


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/7a6cd96a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/7a6cd96a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/7a6cd96a

Branch: refs/heads/master
Commit: 7a6cd96af92aed066b7309c221a50804c5fcbf4d
Parents: bb39078
Author: Bolke de Bruin <bolke@xs4all.nl>
Authored: Sat Mar 11 13:26:39 2017 -0800
Committer: Bolke de Bruin <bolke@xs4all.nl>
Committed: Sat Mar 11 13:26:39 2017 -0800

----------------------------------------------------------------------
 tests/models.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/7a6cd96a/tests/models.py
----------------------------------------------------------------------
diff --git a/tests/models.py b/tests/models.py
index 27c61f0..6fbbf3e 100644
--- a/tests/models.py
+++ b/tests/models.py
@@ -171,10 +171,20 @@ class DagTest(unittest.TestCase):
         topological_list = dag.topological_sort()
         logging.info(topological_list)
 
-        self.assertTrue(topological_list[0] == op5 or topological_list[0] == op4)
-        self.assertTrue(topological_list[1] == op4 or topological_list[1] == op5)
-        self.assertTrue(topological_list[2] == op1 or topological_list[2] == op2)
-        self.assertTrue(topological_list[3] == op1 or topological_list[3] == op2)
+        set1 = [op4, op5]
+        self.assertTrue(topological_list[0] in set1)
+        set1.remove(topological_list[0])
+
+        set2 = [op1, op2]
+        set2.extend(set1)
+        self.assertTrue(topological_list[1] in set2)
+        set2.remove(topological_list[1])
+
+        self.assertTrue(topological_list[2] in set2)
+        set2.remove(topological_list[2])
+
+        self.assertTrue(topological_list[3] in set2)
+
         self.assertTrue(topological_list[4] == op3)
 
         dag = DAG(


Mime
View raw message