Skip to content

Commit

Permalink
add test_remove_clean_cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
b4tman committed Sep 21, 2021
1 parent 46196d2 commit ea1e294
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_webpub1c.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def temp_config(tmpdir) -> str:
vrd_path = tmpdir.mkdir('vrds')
dir_path = tmpdir.mkdir('pubs')
apache_config = tmpdir.join('apache.cfg')
apache_config.write('#start')
apache_config.write('#start\n')

with open(configfile, 'w') as f:
yaml.dump({
Expand Down Expand Up @@ -89,6 +89,24 @@ def test_remove(cmd):
assert [] == cmd.list()


def test_remove_clean_cfg(cmd):
"""
the contents of the apache configuration
before adding and after removing should be the same
"""
assert [] == cmd.list()
cfg_before_add = cmd._apache_cfg.text
cmd.add('test123')
cmd.add('test456')
cfg_before_remove = cmd._apache_cfg.text
cmd.remove('test123')
cmd.remove('test456')
cfg_after_remove = cmd._apache_cfg.text

assert cfg_before_add != cfg_before_remove
assert cfg_before_add == cfg_after_remove


def test_get(cmd):
assert [] == cmd.list()
cmd.add('test123')
Expand Down

0 comments on commit ea1e294

Please sign in to comment.