--- a/pvl/dhcp/tests.py Mon Mar 02 19:36:10 2015 +0200
+++ b/pvl/dhcp/tests.py Mon Mar 02 19:36:39 2015 +0200
@@ -146,3 +146,25 @@
}
""".strip().splitlines()
)
+
+ def testBuildConfItem(self):
+ self.assertLinesEqual(
+ config.build_block(config.Block(None, [], [
+ config.Block(('host', 'foo'), [
+ ('option', 'host-name', "foo.test"),
+ ('fixed-address', '192.0.2.1'),
+ ('hardware', 'ethernet', '00:11:22:33:44:55'),
+ ]),
+ config.Block(None, [
+ ('subclass', 'debian', config.Field('1:00:11:22:33:44:55')),
+ ]),
+ ])),
+ """
+host foo {
+ option host-name "foo.test";
+ fixed-address 192.0.2.1;
+ hardware ethernet 00:11:22:33:44:55;
+}
+subclass debian 1:00:11:22:33:44:55;
+ """.strip().splitlines()
+ )