test_dhcp.py
changeset 1 2223ade4f259
parent 0 257003279747
child 2 e66102ab7048
--- a/test_dhcp.py	Thu Apr 02 17:47:43 2009 +0300
+++ b/test_dhcp.py	Thu Apr 02 20:19:18 2009 +0300
@@ -1,8 +1,9 @@
+#!/usr/bin/env python2.5
 """
     Test conf_dhcp
 """
 
-import conf_dhcp as dhcpc, conf, addr
+import dhcp_conf as dhcpc, conf, addr
 
 import unittest
 from cStringIO import StringIO
@@ -17,11 +18,12 @@
     
     def test_statement (self) :
         self.assert_stmt(dhcpc.Statement("stmt0"),                           "stmt0")
-        self.assert_stmt(dhcpc.Statement("stmt3", [ "this", "that" ]),       "stmt3 this, that")
-        self.assert_stmt(dhcpc.Statement("stmt4", dhcpc.Literal("...")),     "stmt4 ...")
-        self.assert_stmt(dhcpc.Statement("stmt1", u"quux"),                  "stmt1 quux")
-        self.assert_stmt(dhcpc.Statement("stmt1", "bar"),                    "stmt1 bar")
-        self.assert_stmt(dhcpc.Statement("stmt2", 1),                        "stmt2 1")
+        self.assert_stmt(dhcpc.Statement("stmt1", [ "this", "that" ]),       "stmt1 this, that")
+        self.assert_stmt(dhcpc.Statement("stmt2", dhcpc.Literal("...")),     "stmt2 ...")
+        self.assert_stmt(dhcpc.Statement("stmt3", u"quux"),                  "stmt3 quux")
+        self.assert_stmt(dhcpc.Statement("stmt4", "bar"),                    "stmt4 bar")
+        self.assert_stmt(dhcpc.Statement("stmt5", 1),                        "stmt5 1")
+        self.assert_stmt(dhcpc.Statement("stmt6", 1, None, 2),               "stmt6 1 2")
  
     def assert_obj (self, obj, lines) :
         """
@@ -38,7 +40,8 @@
     
     def test_declaration (self) :
         self.assert_obj(dhcpc.Declaration("decl0", ["arg0", "arg1"], [
-            dhcpc.Parameter("param0")
+            dhcpc.Parameter("param0"),
+            None
         ], [
             dhcpc.Declaration("decl0.0", params=[
                 dhcpc.Parameter("param0.0.1", "value")