]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
test: '$' is not removed from path even if triggers random tests 1189/head
authorKefu Chai <kchai@redhat.com>
Mon, 9 Jul 2018 12:39:04 +0000 (20:39 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 9 Jul 2018 12:55:02 +0000 (20:55 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/suite/test/test_build_matrix.py

index 21dee893e51a5a0196eeb06e0d419ac37771c92a..fb6a4d9fefd3c5f65e21183f23f59cdc06e6b811 100644 (file)
@@ -1,3 +1,4 @@
+import os
 import random
 
 from mock import patch, MagicMock
@@ -256,19 +257,17 @@ class TestBuildMatrix(object):
                 },
             },
         }
-        for info in [(fake_fs,'d0_0'), (fake_fs1,'d0_0$')]:
-            fsv = info[0]
-            dval = info[1]
-            self.start_patchers(fsv)
-            result = build_matrix.build_matrix(dval)
+        for fs, root in [(fake_fs,'d0_0'), (fake_fs1,'d0_0$')]:
+            self.start_patchers(fs)
+            result = build_matrix.build_matrix(root)
             assert len(result) == 1
             if result[0][0][1:].startswith('d1_2'):
                 for i in result:
-                    assert 'd0_0/d1_2/d1_2_0.yaml' in i[1]
-                    assert 'd0_0/d1_2/d1_2_1.yaml' in i[1]
-                    assert 'd0_0/d1_2/d1_2_2.yaml' in i[1]
-                    assert 'd0_0/d1_2/d1_2_3.yaml' in i[1]
-            if dval == 'd0_0':
+                    assert os.path.join(root, 'd1_2/d1_2_0.yaml') in i[1]
+                    assert os.path.join(root, 'd1_2/d1_2_1.yaml') in i[1]
+                    assert os.path.join(root, 'd1_2/d1_2_2.yaml') in i[1]
+                    assert os.path.join(root, 'd1_2/d1_2_3.yaml') in i[1]
+            if root == 'd0_0':
                 self.stop_patchers()
 
     def test_random_dollar_sign_with_convolve(self):