Skip to content

Commit

Permalink
Adjusted unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SivolcC committed Sep 25, 2020
1 parent 323348e commit aba1074
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vaultlocker/tests/functional/test_keystorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ def test_encrypt(self, _luks_open, _luks_format, _systemd,
args.block_device = ['/dev/sdb']
args.retry = -1

def mock_path_exists_side_effect(arg):
if arg in ['/usr/lib/systemd/system/[email protected]',
'/etc/systemd/system/[email protected]']:
return True
else:
return False

mock_pathexists = mock.patch('os.path.exists').start()
mock_pathexists.side_effect = mock_path_exists_side_effect
shell.encrypt(args, self.config)

_luks_format.assert_called_once_with(mock.ANY,
'/dev/sdb',
'passed-UUID')
Expand Down

0 comments on commit aba1074

Please sign in to comment.