~harlowja/cloud-init/cloud-init-net-refactor

« back to all changes in this revision

Viewing changes to tests/unittests/test_datasource/test_configdrive.py

  • Committer: Joshua Harlow
  • Date: 2016-05-19 22:33:15 UTC
  • Revision ID: harlowja@gmail.com-20160519223315-2bylbhy01tocjpkx
Fix up tests and flake8 warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
368
368
        self.assertEqual(myds.network_config, network_config)
369
369
 
370
370
    def test_network_config_conversions(self):
371
 
        """Tests a bunch of input network json and checks the expected conversions."""
 
371
        """Tests a bunch of input network json and checks the
 
372
           expected conversions."""
372
373
        in_datas = [
373
374
            NETWORK_DATA,
374
375
            {
375
376
                'services': [{'type': 'dns', 'address': '172.19.0.12'}],
376
 
                'networks': [
377
 
                    {'network_id': 'dacd568d-5be6-4786-91fe-750c374b78b4',
378
 
                     'type': 'ipv4', 'netmask': '255.255.252.0', 
379
 
                     'link': 'tap1a81968a-79', 
380
 
                     'routes': [
381
 
                        {
382
 
                            'netmask': '0.0.0.0',
383
 
                            'network': '0.0.0.0', 
384
 
                            'gateway': '172.19.3.254'
385
 
                        },
386
 
                      ],
387
 
                      'ip_address': '172.19.1.34', 
388
 
                      'id': 'network0',
389
 
                }],
390
 
                'links': [
391
 
                    {'type': 'bridge',
392
 
                     'vif_id': '1a81968a-797a-400f-8a80-567f997eb93f', 
393
 
                     'ethernet_mac_address': 'fa:16:3e:ed:9a:59', 
394
 
                     'id': 'tap1a81968a-79', 'mtu': None}]
 
377
                'networks': [{
 
378
                    'network_id': 'dacd568d-5be6-4786-91fe-750c374b78b4',
 
379
                    'type': 'ipv4',
 
380
                    'netmask': '255.255.252.0',
 
381
                    'link': 'tap1a81968a-79',
 
382
                    'routes': [{
 
383
                        'netmask': '0.0.0.0',
 
384
                        'network': '0.0.0.0',
 
385
                        'gateway': '172.19.3.254',
 
386
                    }],
 
387
                    'ip_address': '172.19.1.34',
 
388
                    'id': 'network0',
 
389
                }],
 
390
                'links': [{
 
391
                    'type': 'bridge',
 
392
                    'vif_id': '1a81968a-797a-400f-8a80-567f997eb93f',
 
393
                    'ethernet_mac_address': 'fa:16:3e:ed:9a:59',
 
394
                    'id': 'tap1a81968a-79',
 
395
                    'mtu': None,
 
396
                }],
395
397
            },
396
398
        ]
397
399
        out_datas = [
440
442
                                'address': '172.19.1.34',
441
443
                                'netmask': '255.255.252.0',
442
444
                                'type': 'static',
 
445
                                'ipv4': True,
443
446
                                'routes': [{
444
447
                                    'gateway': '172.19.3.254',
445
448
                                    'netmask': '0.0.0.0',