--- a/pvl/hosts/tests.py Mon Mar 02 19:43:38 2015 +0200
+++ b/pvl/hosts/tests.py Mon Mar 02 19:45:06 2015 +0200
@@ -624,7 +624,12 @@
class TestDhcp(unittest.TestCase):
def assertBlockEqual(self, block, (key, items, blocks)):
self.assertEqual(block.key, key)
- self.assertItemsEqual(block.items, items)
+
+ for _item, item in itertools.izip_longest(sorted(block.items), sorted(items)):
+ self.assertIsNotNone(_item, item)
+ self.assertIsNotNone(item, _item)
+
+ self.assertEqual(tuple(pvl.dhcp.config.quote(field) for field in _item), item)
for _block, expect_block in itertools.izip_longest(block.blocks, blocks):
self.assertBlockEqual(_block, expect_block)
@@ -659,7 +664,7 @@
self.assertBlocksEqual(list(dhcp.dhcp_host(host)), [
(('host', 'foo.test'), [
- ('option', 'host-name', "foo.test"),
+ ('option', 'host-name', '"foo.test"'),
('fixed-address', '192.0.2.1'),
('hardware', 'ethernet', '00:11:22:33:44:55'),
], [])
@@ -710,24 +715,24 @@
(('host', 'foo1'), [
('option', 'host-name', "foo1"),
('hardware', 'ethernet', '00:11:22:33:44:55'),
- ('next-server', 'boot.lan'),
- ('filename', 'debian/wheezy/pxelinux.0'),
+ ('next-server', '"boot.lan"'),
+ ('filename', '"debian/wheezy/pxelinux.0"'),
], []),
(('host', 'foo2'), [
('option', 'host-name', "foo2"),
('hardware', 'ethernet', '00:11:22:33:44:55'),
- ('next-server', 'boot.lan'),
+ ('next-server', '"boot.lan"'),
], []),
(('host', 'foo3'), [
('option', 'host-name', "foo3"),
('hardware', 'ethernet', '00:11:22:33:44:55'),
- ('filename', '/debian/wheezy/pxelinux.0'),
+ ('filename', '"/debian/wheezy/pxelinux.0"'),
], []),
(('host', 'foo4'), [
('option', 'host-name', "foo4"),
('hardware', 'ethernet', '00:11:22:33:44:55'),
- ('next-server', 'boot.lan'),
- ('filename', '/debian/wheezy/pxelinux.0'),
+ ('next-server', '"boot.lan"'),
+ ('filename', '"/debian/wheezy/pxelinux.0"'),
], []),
])