Browse Source

Update MvS tests for change to read_reverse_dict

Yentl Van Tendeloo 4 years ago
parent
commit
4d48b16549
2 changed files with 9 additions and 13 deletions
  1. 1 1
      scripts/run_tests.py
  2. 8 12
      state/test/test_read_reverse_dict.py

+ 1 - 1
scripts/run_tests.py

@@ -15,6 +15,6 @@ flush_all()
 
 subprocess.check_call([sys.executable, "-m", "pytest"], cwd="interface/HUTN")
 
-subprocess.check_call([sys.executable, "-m", "pytest", "unit", "--runslow", "-x"])
+subprocess.check_call([sys.executable, "-m", "pytest", "unit", "-x"])
 
 subprocess.check_call([sys.executable, "-m", "pytest", "integration", "--runslow", "-s", "-v", "-x"])

+ 8 - 12
state/test/test_read_reverse_dict.py

@@ -11,11 +11,11 @@ class TestReadReverseDict(unittest.TestCase):
 
     def test_read_reverse_dict_not_found_node(self):
         a = self.mvs.create_node()
-        assert a != None
+        assert a != []
 
         # Passing data is not enforced, as the data will be interpreted if necessary
         l = self.mvs.read_reverse_dict(a, "abc")
-        assert l == None
+        assert l == []
 
     def test_read_reverse_dict_not_found_nodevalue(self):
         a = self.mvs.create_nodevalue(1)
@@ -23,7 +23,7 @@ class TestReadReverseDict(unittest.TestCase):
 
         # Passing data is not enforced, as the data will be interpreted if necessary
         l = self.mvs.read_reverse_dict(a, "abc")
-        assert l == None
+        assert l == []
 
     def test_read_reverse_dict_not_found_edge(self):
         a = self.mvs.create_node()
@@ -35,7 +35,7 @@ class TestReadReverseDict(unittest.TestCase):
 
         # Passing data is not enforced, as the data will be interpreted if necessary
         l = self.mvs.read_reverse_dict(c, "abc")
-        assert l == None
+        assert l == []
 
     def test_read_reverse_dict_no_primitive(self):
         a = self.mvs.create_node()
@@ -43,7 +43,7 @@ class TestReadReverseDict(unittest.TestCase):
 
         # Passing data is not enforced, as the data will be interpreted if necessary
         l = self.mvs.read_reverse_dict(a, a)
-        assert l == None
+        assert l == []
 
     def test_read_reverse_dict_node_simple(self):
         a = self.mvs.create_node()
@@ -58,7 +58,6 @@ class TestReadReverseDict(unittest.TestCase):
         assert e != None
 
         l = self.mvs.read_reverse_dict(b, "f")
-        assert l != None
         assert set(l) == set([a])
 
     def test_read_reverse_dict_no_match(self):
@@ -74,7 +73,7 @@ class TestReadReverseDict(unittest.TestCase):
         assert e != None
 
         l = self.mvs.read_reverse_dict(b, "f")
-        assert l == None
+        assert l == []
 
     def test_read_reverse_dict_node_multi(self):
         a = self.mvs.create_node()
@@ -98,15 +97,13 @@ class TestReadReverseDict(unittest.TestCase):
         assert j != None
 
         l = self.mvs.read_reverse_dict(b, "f")
-        assert l != None
         assert set(l) == set([a])
 
         l = self.mvs.read_reverse_dict(g, "k")
-        assert l != None
         assert set(l) == set([a])
 
         l = self.mvs.read_reverse_dict(a, "l")
-        assert l == None
+        assert l == []
 
     def test_read_reverse_dict_node_multi_ambiguous(self):
         a = self.mvs.create_node()
@@ -130,7 +127,6 @@ class TestReadReverseDict(unittest.TestCase):
         assert j != None
 
         l = self.mvs.read_reverse_dict(a, "f")
-        assert l != None
         assert set(l) == set([b, g])
 
     def test_read_reverse_dict_node_uncertain(self):
@@ -151,4 +147,4 @@ class TestReadReverseDict(unittest.TestCase):
         assert i != None
 
         l = self.mvs.read_reverse_dict(b, "f")
-        assert l == None
+        assert set(l) == set([a])