summaryrefslogtreecommitdiff
path: root/cloudinit/safeyaml.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-07-13 10:45:32 -0600
committerChad Smith <chad.smith@canonical.com>2017-07-13 10:45:32 -0600
commit812c36823e085416afab7a35233cb8ff704d2e22 (patch)
tree802f47f4d5738055ef3f1eaaad42fce10aa0a8d5 /cloudinit/safeyaml.py
parent067721672570cc83d54d2c2d5677eeb79bef85e2 (diff)
downloadvyos-cloud-init-812c36823e085416afab7a35233cb8ff704d2e22.tar.gz
vyos-cloud-init-812c36823e085416afab7a35233cb8ff704d2e22.zip
test_gce: Fix invalid mock of platform_reports_gce to return False
The mock of platform_reports_gce is created with a True return value in tests/unittests/test_datasource/test_gce.py:TestDataSourceGCE.setUp(). But, the final test_get_data_returns_false_if_not_on_gce incorrectly attempts to override the mocked return_value of True to False by setting self.m_platform_gce.return_value = False. But, since the mock is already initialized, the updated False is not honored. Instead we should use the patch decorator on the specific unit test to override the return_value of DataSourceGCE.platform_reports_gce to False. A False from platform_reports_gce allows DataSourceGCE.get_data to immediately return False instead of trying to contact metadata.google.internal as the related bug references.
Diffstat (limited to 'cloudinit/safeyaml.py')
0 files changed, 0 insertions, 0 deletions