Skip to content

Commit

Permalink
Add support for python 3.5
Browse files Browse the repository at this point in the history
Use Path.open() instead of open()
Update test to use the mocked assert_called_once()
  • Loading branch information
jjnicola committed May 14, 2020
1 parent 47b907d commit 53d24a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ospd_openvas/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def acquire_lock(self) -> "LockFile":
parent_dir = self._lock_file_path.parent
parent_dir.mkdir(parents=True, exist_ok=True)

self._fd = open(self._lock_file_path, 'w')
self._fd = self._lock_file_path.open('w')
except PermissionError as e:
logger.error(
"Failed to create lock file %s. %s",
Expand Down
1 change: 1 addition & 0 deletions tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from unittest.mock import patch, MagicMock
from ospd_openvas.lock import LockFile
from .helper import assert_called_once


class LockFileTestCase(unittest.TestCase):
Expand Down

0 comments on commit 53d24a2

Please sign in to comment.