-
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.
Merge pull request #36 from eduNEXT/JDB/environment-manager-migration
feat: Migrate project init command to a clean architecture
- Loading branch information
Showing
38 changed files
with
600 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ requests | |
jinja2 | ||
pyyaml | ||
GitPython | ||
requests-cache |
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,30 +1,52 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.8 | ||
# This file is autogenerated by pip-compile with python 3.10 | ||
# To update, run: | ||
# | ||
# make upgrade | ||
# | ||
certifi==2021.5.30 | ||
appdirs==1.4.4 | ||
# via requests-cache | ||
attrs==21.4.0 | ||
# via | ||
# cattrs | ||
# requests-cache | ||
cattrs==22.1.0 | ||
# via requests-cache | ||
certifi==2022.6.15 | ||
# via requests | ||
charset-normalizer==2.0.4 | ||
charset-normalizer==2.1.0 | ||
# via requests | ||
click==8.0.1 | ||
click==8.1.3 | ||
# via -r requirements/base.in | ||
gitdb==4.0.7 | ||
exceptiongroup==1.0.0rc8 | ||
# via | ||
# cattrs | ||
# requests-cache | ||
gitdb==4.0.9 | ||
# via gitpython | ||
gitpython==3.1.18 | ||
gitpython==3.1.27 | ||
# via -r requirements/base.in | ||
idna==3.2 | ||
idna==3.3 | ||
# via requests | ||
jinja2==3.0.1 | ||
jinja2==3.1.2 | ||
# via -r requirements/base.in | ||
markupsafe==2.0.1 | ||
markupsafe==2.1.1 | ||
# via jinja2 | ||
pyyaml==5.4.1 | ||
pyyaml==6.0 | ||
# via -r requirements/base.in | ||
requests==2.26.0 | ||
requests==2.28.1 | ||
# via | ||
# -r requirements/base.in | ||
# requests-cache | ||
requests-cache==0.9.5 | ||
# via -r requirements/base.in | ||
smmap==4.0.0 | ||
six==1.16.0 | ||
# via url-normalize | ||
smmap==5.0.0 | ||
# via gitdb | ||
urllib3==1.26.6 | ||
# via requests | ||
url-normalize==1.4.3 | ||
# via requests-cache | ||
urllib3==1.26.11 | ||
# via | ||
# requests | ||
# requests-cache |
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 |
---|---|---|
|
@@ -9,3 +9,5 @@ pydocstyle | |
coverage | ||
pytest | ||
pudb | ||
requests | ||
requests-cache |
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,14 +1,14 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.8 | ||
# This file is autogenerated by pip-compile with python 3.10 | ||
# To update, run: | ||
# | ||
# make upgrade | ||
# | ||
wheel==0.37.0 | ||
wheel==0.37.1 | ||
# via -r requirements/pip.in | ||
|
||
# The following packages are considered to be unsafe in a requirements file: | ||
pip==21.2.4 | ||
pip==22.2.1 | ||
# via -r requirements/pip.in | ||
setuptools==57.4.0 | ||
setuptools==63.2.0 | ||
# via -r requirements/pip.in |
Empty file.
Empty file.
32 changes: 32 additions & 0 deletions
32
tests/environment_manager/application/test_plugin_installer.py
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,32 @@ | ||
import pytest | ||
|
||
from tests.environment_manager.infrastructure.environment_manager_in_memory_repository import ( | ||
EnvironmentManagerInMemoryRepository, | ||
) | ||
from tvm.environment_manager.application.plugin_installer import PluginInstaller | ||
|
||
|
||
def test_should_install_the_tutor_plugin(): | ||
# Given | ||
options = ["tutor-mfe"] | ||
repository = EnvironmentManagerInMemoryRepository() | ||
|
||
# When | ||
installer = PluginInstaller(repository=repository) | ||
installer(options) | ||
|
||
# Then | ||
assert options in repository.PLUGINS_INSTALLED | ||
|
||
|
||
def test_should_fail_if_not_add_tutor_plugin(): | ||
# Given | ||
options = [] | ||
repository = EnvironmentManagerInMemoryRepository() | ||
|
||
# When | ||
installer = PluginInstaller(repository=repository) | ||
|
||
# Then | ||
with pytest.raises(Exception) as format_err: | ||
installer(options) |
34 changes: 34 additions & 0 deletions
34
tests/environment_manager/application/test_plugin_uninstaller.py
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,34 @@ | ||
import pytest | ||
|
||
from tests.environment_manager.infrastructure.environment_manager_in_memory_repository import ( | ||
EnvironmentManagerInMemoryRepository, | ||
) | ||
from tvm.environment_manager.application.plugin_uninstaller import ( | ||
PluginUninstaller, | ||
) | ||
|
||
|
||
def test_should_uninstall_the_tutor_plugin(): | ||
# Given | ||
options = "codejail" | ||
repository = EnvironmentManagerInMemoryRepository() | ||
|
||
# When | ||
uninstaller = PluginUninstaller(repository=repository) | ||
uninstaller(options) | ||
|
||
# Then | ||
assert options not in repository.PLUGINS_INSTALLED | ||
|
||
|
||
def test_should_fail_if_not_add_tutor_plugin(): | ||
# Given | ||
options = "tutor-mfe" | ||
repository = EnvironmentManagerInMemoryRepository() | ||
|
||
# When | ||
uninstaller = PluginUninstaller(repository=repository) | ||
|
||
# Then | ||
with pytest.raises(Exception) as format_err: | ||
uninstaller(options) |
Oops, something went wrong.