Ubuntu Pastebin

Paste from Chad Smith at Wed, 12 Jul 2017 16:09:24 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py
index 6fd1341..3e8398b 100644
--- a/tests/unittests/test_datasource/test_gce.py
+++ b/tests/unittests/test_datasource/test_gce.py
@@ -163,8 +163,9 @@ class TestDataSourceGCE(test_helpers.HttprettyTestCase):
         self.assertEqual(True, r)
         self.assertEqual('bar', self.ds.availability_zone)
 
-    def test_get_data_returns_false_if_not_on_gce(self):
-        self.m_platform_reports_gce.return_value = False
+    @mock.patch('cloudinit.sources.DataSourceGCE.platform_reports_gce')
+    def test_get_data_returns_false_if_not_on_gce(self, m_platform_gce):
+        m_platform_gce.return_value = False
         self.assertEqual(False, self.ds.get_data())
 
Download as text