Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
diceware-debian
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drebs
diceware-debian
Commits
363be162
Commit
363be162
authored
8 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Flatten quotes-in-conf-values test a bit.
parent
f554cec7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_config.py
+7
-14
7 additions, 14 deletions
tests/test_config.py
with
7 additions
and
14 deletions
tests/test_config.py
+
7
−
14
View file @
363be162
...
@@ -101,21 +101,14 @@ class TestConfigModule(object):
...
@@ -101,21 +101,14 @@ class TestConfigModule(object):
conf_dict
=
get_config_dict
()
conf_dict
=
get_config_dict
()
assert
conf_dict
[
"
delimiter
"
]
==
""
assert
conf_dict
[
"
delimiter
"
]
==
""
def
test_get_config_dict_string_space
(
self
,
home_dir
):
def
test_get_config_dict_string_quotes_stripped
(
self
,
home_dir
):
# We test for the following three cases of whitespace delimiter
# preceding/trailing quotes are stripped from string values
# delimiter=" "
# delimiter=' '
# delimiter=" " (two spaces)
config_file
=
home_dir
/
"
.diceware.ini
"
config_file
=
home_dir
/
"
.diceware.ini
"
config_file
.
write
(
"
\n
"
.
join
([
"
[diceware]
"
,
"
delimiter=
\"
\"
"
]))
for
string_in_conf
,
expected_parsed
in
(
conf_dict
=
get_config_dict
()
(
'"
"'
,
"
"
),
(
"'
'"
,
"
"
),
(
'"
\t\t
"'
,
"
\t\t
"
)):
assert
conf_dict
[
"
delimiter
"
]
==
"
"
config_file
.
write
(
"
[diceware]
\n
delimiter=%s
\n
"
%
string_in_conf
)
config_file
.
write
(
"
\n
"
.
join
([
"
[diceware]
"
,
"
delimiter=
'
'"
]))
conf_dict
=
get_config_dict
()
conf_dict
=
get_config_dict
()
assert
conf_dict
[
"
delimiter
"
]
==
expected_parsed
assert
conf_dict
[
"
delimiter
"
]
==
"
"
config_file
.
write
(
"
\n
"
.
join
([
"
[diceware]
"
,
"
delimiter=
\"
\"
"
]))
conf_dict
=
get_config_dict
()
assert
conf_dict
[
"
delimiter
"
]
==
"
"
class
TestSampleIni
(
object
):
class
TestSampleIni
(
object
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment