mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-26 09:10:13 +00:00
Address:
- Review Comments - Stickler Complaints
This commit is contained in:
parent
59fc3804be
commit
7fa8cdd03e
4 changed files with 29 additions and 32 deletions
|
@ -2,12 +2,12 @@ def test_key_val_replacement_works(host):
|
|||
''' Confirms addOrEditKeyValPair provides the expected output '''
|
||||
host.run('''
|
||||
source /opt/pihole/utils.sh
|
||||
addOrEditKeyValPair "KEY_ONE" "value1" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_TWO" "value2" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_ONE" "value3" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_FOUR" "value4" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_FIVE_NO_VALUE" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_FIVE_NO_VALUE" "./testoutput"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value1"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_TWO" "value2"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value3"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_FOUR" "value4"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_FIVE_NO_VALUE"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_FIVE_NO_VALUE"
|
||||
''')
|
||||
output = host.run('''
|
||||
cat ./testoutput
|
||||
|
@ -15,13 +15,14 @@ def test_key_val_replacement_works(host):
|
|||
expected_stdout = 'KEY_ONE=value3\nKEY_TWO=value2\nKEY_FOUR=value4\nKEY_FIVE_NO_VALUE\n'
|
||||
assert expected_stdout == output.stdout
|
||||
|
||||
|
||||
def test_key_val_removal_works(host):
|
||||
''' Confirms addOrEditKeyValPair provides the expected output '''
|
||||
host.run('''
|
||||
source /opt/pihole/utils.sh
|
||||
addOrEditKeyValPair "KEY_ONE" "value1" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_TWO" "value2" "./testoutput"
|
||||
addOrEditKeyValPair "KEY_THREE" "value3" "./testoutput"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_ONE" "value1"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_TWO" "value2"
|
||||
addOrEditKeyValPair "./testoutput" "KEY_THREE" "value3"
|
||||
removeKey "KEY_TWO" "./testoutput"
|
||||
''')
|
||||
output = host.run('''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue