pvl/dhcp/tests.py
changeset 685 668f934bb958
parent 682 60dbd952a15e
child 695 c60924eca185
equal deleted inserted replaced
684:fbac5a08c9d3 685:668f934bb958
   117         for line, expect in itertools.izip_longest(lines, expected):
   117         for line, expect in itertools.izip_longest(lines, expected):
   118             self.assertEqualWhitespace(line, expect)
   118             self.assertEqualWhitespace(line, expect)
   119 
   119 
   120     def testBuildConf(self):
   120     def testBuildConf(self):
   121         self.assertLinesEqual(
   121         self.assertLinesEqual(
   122                 config.build_block(config.Block(('group', ), [
   122                 config.build_block(config.Block(None, [], [
       
   123                     config.Block(('group', ), [
   123                         ('next-server', 'boot.test'),
   124                         ('next-server', 'boot.test'),
   124                         ('filename', "/debian/wheezy/pxelinux.0"),
   125                         ('filename', "/debian/wheezy/pxelinux.0"),
   125                         ('include', "hosts/test.conf"),
   126                         ('include', "hosts/test.conf"),
   126                     ], [
   127                     ], [
   127                         config.Block(('host', 'foo'), [
   128                         config.Block(('host', 'foo'), [
   128                             ('option', 'host-name', "foo.test"),
   129                             ('option', 'host-name', "foo.test"),
   129                             ('fixed-address', '192.0.2.1'),
   130                             ('fixed-address', '192.0.2.1'),
   130                             ('hardware', 'ethernet', '00:11:22:33:44:55'),
   131                             ('hardware', 'ethernet', '00:11:22:33:44:55'),
   131                         ]),
   132                         ]),
   132                     ]
   133                     ]),
   133                 )),
   134                 ])),
   134                 """
   135                 """
   135 group {
   136 group {
   136     next-server boot.test;
   137     next-server boot.test;
   137     filename "/debian/wheezy/pxelinux.0";
   138     filename "/debian/wheezy/pxelinux.0";
   138     include "hosts/test.conf";
   139     include "hosts/test.conf";