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
cebd7e35
Commit
cebd7e35
authored
Jul 27, 2011
by
Naoki Kambe
Browse files
[trac930] modify parse_spec function returns empty dict if list-type
is not specified in the argument
parent
8750dc3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/stats/stats.py.in
View file @
cebd7e35
...
...
@@ -72,6 +72,7 @@ def parse_spec(spec):
"""
parse spec type data
"""
if type(spec) is not list: return {}
def _parse_spec(spec):
item_type = spec['item_type']
if item_type == "integer":
...
...
src/bin/stats/tests/b10-stats_test.py
View file @
cebd7e35
...
...
@@ -69,7 +69,7 @@ class TestUtilties(unittest.TestCase):
'test_list2'
:
[
0
,
0
,
0
],
'test_map2'
:
{
'A'
:
0
,
'B'
:
0
,
'C'
:
0
},
'test_none'
:
None
})
self
.
assert
Raises
(
TypeError
,
stats
.
parse_spec
,
None
)
self
.
assert
Equal
(
stats
.
parse_spec
(
None
)
,
{})
self
.
assertRaises
(
KeyError
,
stats
.
parse_spec
,
[{
'item_name'
:
'Foo'
}])
def
test_get_timestamp
(
self
):
...
...
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