pvl/dhcp/tests.py
changeset 695 c60924eca185
parent 685 668f934bb958
child 699 d34567c1b21a
--- 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()
+        )