← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~daniel-thewatkins/cloud-init/+git/cloud-init:networking into cloud-init:master

 


Diff comments:

> diff --git a/cloudinit/sources/tests/test_oracle.py b/cloudinit/sources/tests/test_oracle.py
> index 97d6294..282382c 100644
> --- a/cloudinit/sources/tests/test_oracle.py
> +++ b/cloudinit/sources/tests/test_oracle.py
> @@ -145,15 +145,15 @@ class TestDataSourceOracle(test_helpers.CiTestCase):
>                      MD_VER: {'system_uuid': self.my_uuid,
>                               'meta_data': self.my_md}}}})
>          ncfg = {'version': 1, 'config': [{'a': 'b'}]}
> -        m_cmdline_config.return_value = ncfg
> +        m_initramfs_config.return_value = ncfg
>          self.assertTrue(ds._get_data())
>          self.assertEqual(ncfg, ds.network_config)
> -        m_cmdline_config.assert_called_once_with()
> +        self.assertEqual([mock.call()], m_initramfs_config.call_args_list)

This, specifically, is testing that it is called with no parameters (`mock.call()`), which is what the replaced line was doing previously[0].  Are you asking to confirm that we are doing that (we are!), or are you suggesting that we should relax the test here to not check that?

[0] I generally prefer to avoid the assertion methods on mocks, as mistyping them is very easy to miss during code review and can lead to tests silently passing.  As I was modifying the line anyway, I figured I'd make this change also.

>          self.assertFalse(distro.generate_fallback_config.called)
>  
> -    @mock.patch(DS_PATH + ".cmdline.read_kernel_cmdline_config")
> +    @mock.patch(DS_PATH + ".cmdline.read_initramfs_config")
>      @mock.patch(DS_PATH + "._is_iscsi_root", return_value=True)
> -    def test_network_fallback(self, m_is_iscsi_root, m_cmdline_config):
> +    def test_network_fallback(self, m_is_iscsi_root, m_initramfs_config):
>          """test that fallback network is generated if no kernel cmdline."""
>          distro = mock.MagicMock()
>          ds, _ = self._get_ds(distro=distro, patches={


-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/370526
Your team cloud-init commiters is requested to review the proposed merge of ~daniel-thewatkins/cloud-init/+git/cloud-init:networking into cloud-init:master.


References