-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4de86d
commit e49de8b
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from unittest.case import TestCase | ||
from unittest.mock import patch | ||
|
||
from ntk.installer import auto_install_and_generate_ntk_command | ||
|
||
|
||
class TestInstaller(TestCase): | ||
def test_auto_install_and_generate_ntk_command_should_call_subprocess_and_os_correctly(self): | ||
with patch("subprocess.run") as mock_subprocess, patch("os.system") as mock_os: | ||
auto_install_and_generate_ntk_command() | ||
|
||
mock_subprocess.assert_called_with(['python', '-m', 'pip', 'install', 'next-theme-kit']) | ||
|
||
mock_os.assert_any_call("doskey ntk=python -m ntk $*") | ||
|
||
mock_os.assert_any_call("cmd /k") |