Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
a3cf5322
Commit
a3cf5322
authored
Jan 06, 2012
by
Michal 'vorner' Vaner
Browse files
Merge #1515
parents
55982f50
0d120aa6
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/lib/config/tests/testdata/Makefile.am
View file @
a3cf5322
...
...
@@ -65,3 +65,4 @@ EXTRA_DIST += spec35.spec
EXTRA_DIST
+=
spec36.spec
EXTRA_DIST
+=
spec37.spec
EXTRA_DIST
+=
spec38.spec
EXTRA_DIST
+=
spec39.spec
src/lib/config/tests/testdata/spec39.spec
0 → 100644
View file @
a3cf5322
{
"module_spec": {
"module_name": "Spec39",
"config_data": [
{ "item_name": "list",
"item_type": "list",
"item_optional": false,
"item_default": [],
"list_item_spec": {
"item_name": "list_item",
"item_type": "boolean",
"item_optional": false,
"item_default": false
}
}
],
"commands": [],
"statistics": []
}
}
src/lib/python/isc/config/ccsession.py
View file @
a3cf5322
...
...
@@ -451,9 +451,9 @@ class UIModuleCCSession(MultiConfigData):
cur_list
.
append
(
value
)
self
.
set_value
(
identifier
,
cur_list
)
else
:
raise
isc
.
cc
.
data
.
DataAlreadyPresentError
(
value
+
raise
isc
.
cc
.
data
.
DataAlreadyPresentError
(
str
(
value
)
+
" already in "
+
identifier
)
+
str
(
identifier
)
)
def
_add_value_to_named_set
(
self
,
identifier
,
value
,
item_value
):
if
type
(
value
)
!=
str
:
...
...
src/lib/python/isc/config/tests/ccsession_test.py
View file @
a3cf5322
...
...
@@ -701,6 +701,12 @@ class TestUIModuleCCSession(unittest.TestCase):
fake_conn
.
set_get_answer
(
'/config_data'
,
{
'version'
:
BIND10_CONFIG_DATA_VERSION
})
return
UIModuleCCSession
(
fake_conn
)
def
create_uccs_listtest
(
self
,
fake_conn
):
module_spec
=
isc
.
config
.
module_spec_from_file
(
self
.
spec_file
(
"spec39.spec"
))
fake_conn
.
set_get_answer
(
'/module_spec'
,
{
module_spec
.
get_module_name
():
module_spec
.
get_full_spec
()})
fake_conn
.
set_get_answer
(
'/config_data'
,
{
'version'
:
BIND10_CONFIG_DATA_VERSION
})
return
UIModuleCCSession
(
fake_conn
)
def
test_init
(
self
):
fake_conn
=
fakeUIConn
()
fake_conn
.
set_get_answer
(
'/module_spec'
,
{})
...
...
@@ -751,6 +757,14 @@ class TestUIModuleCCSession(unittest.TestCase):
self
.
assertRaises
(
isc
.
cc
.
data
.
DataTypeError
,
uccs
.
remove_value
,
"Spec2/item5"
,
None
)
def
test_add_dup_value
(
self
):
fake_conn
=
fakeUIConn
()
uccs
=
self
.
create_uccs_listtest
(
fake_conn
)
uccs
.
add_value
(
"Spec39/list"
)
self
.
assertRaises
(
isc
.
cc
.
data
.
DataAlreadyPresentError
,
uccs
.
add_value
,
"Spec39/list"
)
def
test_add_remove_value_named_set
(
self
):
fake_conn
=
fakeUIConn
()
uccs
=
self
.
create_uccs_named_set
(
fake_conn
)
...
...
@@ -787,6 +801,8 @@ class TestUIModuleCCSession(unittest.TestCase):
self
.
assertRaises
(
isc
.
cc
.
data
.
DataNotFoundError
,
uccs
.
remove_value
,
"/Spec32/named_set_item"
,
"no_such_item"
)
self
.
assertRaises
(
isc
.
cc
.
data
.
DataAlreadyPresentError
,
uccs
.
add_value
,
"/Spec32/named_set_item"
,
"c"
)
def
test_set_value_named_set
(
self
):
fake_conn
=
fakeUIConn
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment