← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~smoser/cloud-init:open-nebula-no-ip into cloud-init:master

 


Diff comments:

> diff --git a/tests/unittests/test_datasource/test_opennebula.py b/tests/unittests/test_datasource/test_opennebula.py
> index d796f03..339d8a4 100644
> --- a/tests/unittests/test_datasource/test_opennebula.py
> +++ b/tests/unittests/test_datasource/test_opennebula.py
> @@ -233,18 +228,19 @@ class TestOpenNebulaDataSource(TestCase):
>  
>  class TestOpenNebulaNetwork(unittest.TestCase):
>  
> -    def setUp(self):
> -        super(TestOpenNebulaNetwork, self).setUp()
> +    macs = {'02:00:0a:12:01:01': 'eth0'}

maybe call this system_nics;  below it looks like you're passing in a list of macs only.

>  
>      def test_lo(self):
> -        net = ds.OpenNebulaNetwork('', {})
> +        net = ds.OpenNebulaNetwork(context={}, system_nics_by_mac={})
>          self.assertEqual(net.gen_conf(), u'''\
>  auto lo
>  iface lo inet loopback
>  ''')
>  
> -    def test_eth0(self):
> -        net = ds.OpenNebulaNetwork(CMD_IP_OUT, {})
> +    @mock.patch(DS_PATH + ".get_physical_nics_by_mac")
> +    def test_eth0(self, m_get_phys_by_mac):
> +        m_get_phys_by_mac.return_value = self.macs
> +        net = ds.OpenNebulaNetwork({})
>          self.assertEqual(net.gen_conf(), u'''\
>  auto lo
>  iface lo inet loopback


-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/307200
Your team cloud init development team is requested to review the proposed merge of ~smoser/cloud-init:open-nebula-no-ip into cloud-init:master.


References