-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [Codacy] Removendo as vulnerabilidades criticas
- Loading branch information
1 parent
d90d0dc
commit c2f86da
Showing
6 changed files
with
22 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.1.dev1+g7aff1b9.d20240529 | ||
1.0.1.dev7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pycryptodomex >=3.20.0 | ||
rich-click >=1.8.2 | ||
colorama >=0.4.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
""" Modulo para testar a função clear_console em utils.py""" | ||
"""Modulo para testar a função clear_console em utils.py""" | ||
|
||
from unittest import mock | ||
|
||
from encryptdef.utils import clear_console | ||
|
||
|
||
@mock.patch("subprocess.run") # Substitui subprocess.run por um mock | ||
def test_clear_console_posix(mock_run): | ||
"""Test function clear_console""" | ||
@mock.patch("builtins.print") | ||
def test_clear_console_posix(mock_print): | ||
"""Testa a função clear_console em sistemas POSIX""" | ||
with mock.patch("os.name", "posix"): | ||
clear_console() | ||
mock_print.assert_called_once_with("\033[H\033[J", end="") | ||
|
||
# Verifica se subprocess.run foi chamado com ["cls"] e check=False | ||
mock_run.assert_called_once_with(["clear"], check=False) | ||
|
||
|
||
@mock.patch("subprocess.run") | ||
def test_clear_console_nt(mock_run): | ||
"""Test function clear_console""" | ||
@mock.patch("builtins.print") | ||
def test_clear_console_nt(mock_print): | ||
"""Testa a função clear_console em sistemas Windows""" | ||
with mock.patch("os.name", "nt"): | ||
clear_console() | ||
mock_run.assert_called_once_with(["cls"], shell=True, check=False) | ||
mock_print.assert_called_once_with("\033c", end="") |