mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-10-30 21:33:43 +00:00 
			
		
		
		
	use nosec instead of disabling mktemp rule
This commit is contained in:
		| @ -1 +1 @@ | ||||
| skips: ['B101', 'B306', 'B404'] | ||||
| skips: ['B101', 'B404'] | ||||
| @ -111,7 +111,7 @@ def test_clear(lock: Lock) -> None: | ||||
|     """ | ||||
|     must remove lock file | ||||
|     """ | ||||
|     lock.path = Path(tempfile.mktemp()) | ||||
|     lock.path = Path(tempfile.mktemp())  # nosec | ||||
|     lock.path.touch() | ||||
|  | ||||
|     lock.clear() | ||||
| @ -122,7 +122,7 @@ def test_clear_missing(lock: Lock) -> None: | ||||
|     """ | ||||
|     must not fail on lock removal if file is missing | ||||
|     """ | ||||
|     lock.path = Path(tempfile.mktemp()) | ||||
|     lock.path = Path(tempfile.mktemp())  # nosec | ||||
|     lock.clear() | ||||
|  | ||||
|  | ||||
| @ -139,7 +139,7 @@ def test_create(lock: Lock) -> None: | ||||
|     """ | ||||
|     must create lock | ||||
|     """ | ||||
|     lock.path = Path(tempfile.mktemp()) | ||||
|     lock.path = Path(tempfile.mktemp())  # nosec | ||||
|  | ||||
|     lock.create() | ||||
|     assert lock.path.is_file() | ||||
| @ -150,7 +150,7 @@ def test_create_exception(lock: Lock) -> None: | ||||
|     """ | ||||
|     must raise exception if file already exists | ||||
|     """ | ||||
|     lock.path = Path(tempfile.mktemp()) | ||||
|     lock.path = Path(tempfile.mktemp())  # nosec | ||||
|     lock.path.touch() | ||||
|  | ||||
|     with pytest.raises(DuplicateRun): | ||||
| @ -172,7 +172,7 @@ def test_create_unsafe(lock: Lock) -> None: | ||||
|     must not raise exception if force flag set | ||||
|     """ | ||||
|     lock.force = True | ||||
|     lock.path = Path(tempfile.mktemp()) | ||||
|     lock.path = Path(tempfile.mktemp())  # nosec | ||||
|     lock.path.touch() | ||||
|  | ||||
|     lock.create() | ||||
|  | ||||
| @ -106,7 +106,7 @@ def test_cache_save_load(watcher: Watcher, package_ahriman: Package, mocker: Moc | ||||
|     """ | ||||
|     must save state to cache which can be loaded later | ||||
|     """ | ||||
|     dump_file = Path(tempfile.mktemp()) | ||||
|     dump_file = Path(tempfile.mktemp())   # nosec | ||||
|     mocker.patch("ahriman.core.status.watcher.Watcher.cache_path", | ||||
|                  new_callable=PropertyMock, return_value=dump_file) | ||||
|     known_current = {package_ahriman.base: (package_ahriman, BuildStatus())} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user