]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
suite: Fix updated unit test
authorZack Cerza <zack@redhat.com>
Mon, 2 Nov 2015 20:18:26 +0000 (13:18 -0700)
committerZack Cerza <zack@redhat.com>
Mon, 2 Nov 2015 20:20:33 +0000 (13:20 -0700)
First, split half of test_schedule_suite into
test_schedule_suite_noverify. Also reflect the fact that Mock doesn't
provide a simple assert_called().

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/test_suite.py

index d6e9a253fcb6e5924b018259af226094a9b1852c..c7888c3e2af35daa221a906e5d0a545999177ddc 100644 (file)
@@ -787,13 +787,20 @@ class TestSuiteMain(object):
                 get_hash=DEFAULT,
                 package_version_for_hash=lambda *args: 'fake-9.5',
                 ) as m:
-            config.suite_verify_ceph_hash = False
+            config.suite_verify_ceph_hash = True
+            m['get_hash'].return_value = '12345'
             main(['--suite', suite_name,
                   '--suite-dir', 'teuthology/test',
                   '--throttle', throttle,
                   '--machine-type', machine_type])
             m['sleep'].assert_called_with(int(throttle))
-            m['get_hash'].assert_not_called()
+            m['get_hash'].assert_called_with('ceph', 'master', 'basic',
+                                             machine_type, None)
+
+    def test_schedule_suite_noverify(self):
+        suite_name = 'noop'
+        throttle = '3'
+        machine_type = 'burnupi'
 
         with patch.multiple(
                 suite,
@@ -805,11 +812,10 @@ class TestSuiteMain(object):
                 get_hash=DEFAULT,
                 package_version_for_hash=lambda *args: 'fake-9.5',
                 ) as m:
-            config.suite_verify_ceph_hash = True
-            m['get_hash'].return_value = '12345'
+            config.suite_verify_ceph_hash = False
             main(['--suite', suite_name,
                   '--suite-dir', 'teuthology/test',
                   '--throttle', throttle,
                   '--machine-type', machine_type])
             m['sleep'].assert_called_with(int(throttle))
-            m['get_hash'].assert_called()
+            m['get_hash'].assert_not_called()