pvl/hosts/tests.py
changeset 508 a47849709cbf
parent 507 e3a32f4dff54
child 509 ae53114766fc
equal deleted inserted replaced
507:e3a32f4dff54 508:a47849709cbf
    24 
    24 
    25         for attr, value in attrs.iteritems():
    25         for attr, value in attrs.iteritems():
    26             self.assertEquals(getattr(host, attr), value)
    26             self.assertEquals(getattr(host, attr), value)
    27 
    27 
    28     def assertHostsEqual(self, hosts, expected):
    28     def assertHostsEqual(self, hosts, expected):
       
    29         hosts = list(hosts)
       
    30 
    29         for host, expect in zip(hosts, expected):
    31         for host, expect in zip(hosts, expected):
    30             host_str, attrs = expect
    32             host_str, attrs = expect
    31 
    33 
    32             self.assertHostEqual(host, host_str, attrs)
    34             self.assertHostEqual(host, host_str, attrs)
       
    35 
       
    36         self.assertEqual(len(hosts), len(expected))
    33  
    37  
    34     def testApplyHostConfigDict(self):
    38     def testApplyHostConfigDict(self):
    35         host = config.apply_host('foo', 'test', {
    39         host = config.apply_host('foo', 'test', {
    36             'ethernet.eth0': '00:11:22:33:44:55',
    40             'ethernet.eth0': '00:11:22:33:44:55',
    37         })
    41         })