Browse Source

Update test cases for bindctl.(skip review)

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1960 e5f2f494-b856-4b98-b285-d166d9295462
Likun Zhang 15 years ago
parent
commit
508a2ffe37
1 changed files with 13 additions and 4 deletions
  1. 13 4
      src/bin/bindctl/tests/bindctl_test.py

+ 13 - 4
src/bin/bindctl/tests/bindctl_test.py

@@ -15,6 +15,7 @@
 
 
 import unittest
+import isc.cc.data
 from bindctl import cmdparse
 from bindctl import bindcmd
 from bindctl.moduleinfo import *
@@ -92,14 +93,21 @@ class TestCmdSyntax(unittest.TestCase):
         """Create one bindcmd"""
         
         tool = bindcmd.BindCmdInterpreter()        
-        zone_file_param = ParamInfo(name = "zone_file")
-        zone_name = ParamInfo(name = 'zone_name')
+        string_spec = { 'item_type' : 'string',
+                       'item_optional' : False,
+                       'item_default' : ''}
+        int_spec = { 'item_type' : 'integer',
+                       'item_optional' : False,
+                       'item_default' : 10}
+        zone_file_param = ParamInfo(name = "zone_file", param_spec = string_spec)
+        zone_name = ParamInfo(name = 'zone_name', param_spec = string_spec)
         load_cmd = CommandInfo(name = "load")
         load_cmd.add_param(zone_file_param)
         load_cmd.add_param(zone_name)
         
-        param_master = ParamInfo(name = "master", optional = True)                                 
-        param_allow_update = ParamInfo(name = "allow_update", optional = True)                                           
+        param_master = ParamInfo(name = "master", optional = True, param_spec = string_spec)                                 
+        param_master = ParamInfo(name = "port", optional = True, param_spec = int_spec)                                 
+        param_allow_update = ParamInfo(name = "allow_update", optional = True, param_spec = string_spec)                                           
         set_cmd = CommandInfo(name = "set")
         set_cmd.add_param(param_master)
         set_cmd.add_param(param_allow_update)
@@ -138,6 +146,7 @@ class TestCmdSyntax(unittest.TestCase):
         self.no_assert_raise("zone help help='dd' ")
         self.no_assert_raise("zone set allow_update='1.1.1.1' zone_name='cn'")
         self.no_assert_raise("zone set zone_name='cn'")
+        self.my_assert_raise(isc.cc.data.DataTypeError, "zone set zone_name ='cn', port='cn'")
         self.no_assert_raise("zone reload_all")