Browse Source

[1220] Add testcase which checks use of trailing slashes with indices

Trailing slashes are supposed to work. It should not result in an error
like this:

  > config show Resolver/listen_on
  Resolver/listen_on[0]/address   "::1"   string
  Resolver/listen_on[0]/port      53      integer
  > config show Resolver/listen_on/
  Error: Resolver/listen_on/[0]/address not found

Bug #1220 was fixed as a part of bug #1649 (see commit
b31b7eff36397f30f00d7c31805bf7634395dfa8). We just add another testcase
for bug #1220.
Mukund Sivaraman 13 years ago
parent
commit
365b5c443a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/lib/python/isc/config/tests/config_data_test.py

+ 10 - 0
src/lib/python/isc/config/tests/config_data_test.py

@@ -618,6 +618,16 @@ class TestMultiConfigData(unittest.TestCase):
         maps = self.mcd.get_value_maps("/Spec22/value9/")
         self.assertEqual(expected, maps)
 
+        # A slash at the end should not produce different output with
+        # indices too
+        expected2 = [{'default': True,
+                      'type': 'integer',
+                      'name': 'Spec22/value5[1]',
+                      'value': 'b',
+                      'modified': False}]
+        maps = self.mcd.get_value_maps("/Spec22/value5[1]/")
+        self.assertEqual(expected2, maps)
+
     def test_get_value_maps_named_set(self):
         module_spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec32.spec")
         self.mcd.set_specification(module_spec)