diff --git a/gcc_exec/gcc_workflow.py b/gcc_exec/gcc_workflow.py index c38025b..ab57704 100644 --- a/gcc_exec/gcc_workflow.py +++ b/gcc_exec/gcc_workflow.py @@ -11,11 +11,10 @@ import xmltodict from botocore.exceptions import ClientError - -from gcc_exec.gcc_drbx import GccDrbx -from gcc_exec.gcc_ec2 import GccEc2 -from gcc_exec.gcc_node import GccNode -from gcc_exec.gcc_user import GccUser +from gcc_drbx import GccDrbx +from gcc_ec2 import GccEc2 +from gcc_node import GccNode +from gcc_user import GccUser class GccWorkflow: diff --git a/gcc_exec/tests/test_gcc_drbx.py b/gcc_exec/tests/test_gcc_drbx.py index 72fe2b5..ee11bf3 100644 --- a/gcc_exec/tests/test_gcc_drbx.py +++ b/gcc_exec/tests/test_gcc_drbx.py @@ -1,12 +1,11 @@ """This file contains the TestGccDrbx class.""" - +# pylint: disable=E0401 import os from os.path import dirname, join from dotenv import load_dotenv from dropbox.files import CreateFolderResult, DeleteResult, FileMetadata, FolderMetadata - -from gcc_exec.gcc_drbx import GccDrbx +from gcc_drbx import GccDrbx class TestGccDrbx: diff --git a/gcc_exec/tests/test_gcc_ec2.py b/gcc_exec/tests/test_gcc_ec2.py index c9eedaa..88f9aee 100644 --- a/gcc_exec/tests/test_gcc_ec2.py +++ b/gcc_exec/tests/test_gcc_ec2.py @@ -7,8 +7,7 @@ import pytest from botocore.exceptions import ClientError from dotenv import load_dotenv - -from gcc_exec.gcc_ec2 import GccEc2 +from gcc_ec2 import GccEc2 class TestGccEc2: diff --git a/gcc_exec/tests/test_gcc_workflow.py b/gcc_exec/tests/test_gcc_workflow.py index 3a2911e..a707607 100644 --- a/gcc_exec/tests/test_gcc_workflow.py +++ b/gcc_exec/tests/test_gcc_workflow.py @@ -1,14 +1,13 @@ """This file contains the TestGccWorkflow class.""" -# pylint: disable=W1514,R0913 +# pylint: disable=W1514,R0913,E0401 import os from os.path import dirname, join from unittest import mock import pytest from dotenv import load_dotenv - -from gcc_exec.gcc_user import GccUser -from gcc_exec.gcc_workflow import GccWorkflow +from gcc_user import GccUser +from gcc_workflow import GccWorkflow class TestGccWorkflow: @@ -105,19 +104,19 @@ def test_plan( ) @mock.patch( - "gcc_exec.gcc_node.GccNode.initialize", + "gcc_node.GccNode.initialize", return_value=None, ) @mock.patch( - "gcc_exec.gcc_ec2.GccEc2.create_key_pair", + "gcc_ec2.GccEc2.create_key_pair", return_value=None, ) @mock.patch( - "gcc_exec.gcc_ec2.GccEc2.create_security_group", + "gcc_ec2.GccEc2.create_security_group", return_value=None, ) @mock.patch( - "gcc_exec.gcc_drbx.GccDrbx.create_folder", + "gcc_drbx.GccDrbx.create_folder", return_value=None, ) @mock.patch("os.makedirs", return_value=None) @@ -178,12 +177,10 @@ def test_initialize( assert mock_makedirs.called @mock.patch( - "gcc_exec.gcc_node.GccNode.set_config_commands", + "gcc_node.GccNode.set_config_commands", return_value=None, ) - @mock.patch( - "gcc_exec.gcc_node.GccNode.configure_virtual_machine", return_value=None - ) + @mock.patch("gcc_node.GccNode.configure_virtual_machine", return_value=None) @pytest.mark.parametrize( "xml_specification_filename,workflow_name", [ @@ -224,7 +221,7 @@ def test_configure( assert mock_configure_virtual_machine.called @mock.patch( - "gcc_exec.gcc_node.GccNode.execute", + "gcc_node.GccNode.execute", return_value=None, ) @mock.patch("time.sleep", return_value=None) @@ -280,15 +277,15 @@ def test_execute( assert mock_execute.called @mock.patch( - "gcc_exec.gcc_node.GccNode.terminate", + "gcc_node.GccNode.terminate", return_value=None, ) @mock.patch( - "gcc_exec.gcc_ec2.GccEc2.delete_key_pair", + "gcc_ec2.GccEc2.delete_key_pair", return_value=None, ) @mock.patch( - "gcc_exec.gcc_ec2.GccEc2.delete_security_group", + "gcc_ec2.GccEc2.delete_security_group", return_value=None, ) @mock.patch("shutil.rmtree", return_value=None) diff --git a/poetry.lock b/poetry.lock index 7cd5fe0..6e76feb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -82,14 +82,14 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "boto3" -version = "1.21.35" +version = "1.21.42" description = "The AWS SDK for Python" category = "main" optional = false python-versions = ">= 3.6" [package.dependencies] -botocore = ">=1.24.35,<1.25.0" +botocore = ">=1.24.42,<1.25.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.5.0,<0.6.0" @@ -98,7 +98,7 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.24.35" +version = "1.24.42" description = "Low-level, data-driven core of boto 3." category = "main" optional = false @@ -207,7 +207,7 @@ graph = ["objgraph (>=1.7.2)"] [[package]] name = "django" -version = "4.0.3" +version = "4.0.4" description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." category = "main" optional = false @@ -501,7 +501,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "pylint" -version = "2.13.4" +version = "2.13.5" description = "python code static checker" category = "dev" optional = false @@ -536,14 +536,14 @@ tests = ["pytest (>=3.2.1,!=3.3.0)", "hypothesis (>=3.27.0)"] [[package]] name = "pyparsing" -version = "3.0.7" -description = "Python parsing module" +version = "3.0.8" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.6.8" [package.extras] -diagrams = ["jinja2", "railroad-diagrams"] +diagrams = ["railroad-diagrams", "jinja2"] [[package]] name = "pytest" @@ -729,14 +729,6 @@ category = "main" optional = false python-versions = ">=2" -[[package]] -name = "unittest" -version = "0.0" -description = "" -category = "main" -optional = false -python-versions = "*" - [[package]] name = "urllib3" version = "1.26.9" @@ -769,7 +761,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [metadata] lock-version = "1.1" python-versions = "^3.10" -content-hash = "b5828162bd35c98dd737a8948d9858934a310ed01802f0714e6500861b725957" +content-hash = "58c9033e7250a338634c7a6fbad7b95b2573441a044601b06b4141da5f43da92" [metadata.files] asgiref = [ @@ -826,12 +818,12 @@ black = [ {file = "black-22.3.0.tar.gz", hash = "sha256:35020b8886c022ced9282b51b5a875b6d1ab0c387b31a065b84db7c33085ca79"}, ] boto3 = [ - {file = "boto3-1.21.35-py3-none-any.whl", hash = "sha256:4fb810755bca4696effbeb0c6f792295795fae52e895638038dff53965f3f423"}, - {file = "boto3-1.21.35.tar.gz", hash = "sha256:ab6e001ba9de1db986634424abff6c79d938c15d0d2fa3ef95eb0939c120b4f6"}, + {file = "boto3-1.21.42-py3-none-any.whl", hash = "sha256:895fb88c69be78f82cfee58a79c97a3ad8d4a2a1209041a411d7d6b9fc5393e4"}, + {file = "boto3-1.21.42.tar.gz", hash = "sha256:bcb541175a7d190dd919a0af0e807ee6e9d26f135551e741b10d94343f2d7588"}, ] botocore = [ - {file = "botocore-1.24.35-py3-none-any.whl", hash = "sha256:734aa598af5d6bc0351e6ecce4a91b0b6ccf245febfd8d4de8425211aada5f36"}, - {file = "botocore-1.24.35.tar.gz", hash = "sha256:36b5422d8f0c312983582b8b4b056c98e1fd6121cb0b2ddb1f67e882e1ae6867"}, + {file = "botocore-1.24.42-py3-none-any.whl", hash = "sha256:14aee41c8bf59d2dd2d89e8751fa37d3c95dcb92707d1966aa02697e914c1417"}, + {file = "botocore-1.24.42.tar.gz", hash = "sha256:a2baa9484bbaee96ef312c049b8e360badcab58329e487b57567644a571b5f4a"}, ] certifi = [ {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, @@ -971,8 +963,8 @@ dill = [ {file = "dill-0.3.4.zip", hash = "sha256:9f9734205146b2b353ab3fec9af0070237b6ddae78452af83d2fca84d739e675"}, ] django = [ - {file = "Django-4.0.3-py3-none-any.whl", hash = "sha256:1239218849e922033a35d2a2f777cb8bee18bd725416744074f455f34ff50d0c"}, - {file = "Django-4.0.3.tar.gz", hash = "sha256:77ff2e7050e3324c9b67e29b6707754566f58514112a9ac73310f60cd5261930"}, + {file = "Django-4.0.4-py3-none-any.whl", hash = "sha256:07c8638e7a7f548dc0acaaa7825d84b7bd42b10e8d22268b3d572946f1e9b687"}, + {file = "Django-4.0.4.tar.gz", hash = "sha256:4e8177858524417563cc0430f29ea249946d831eacb0068a1455686587df40b5"}, ] django-appconf = [ {file = "django-appconf-1.0.5.tar.gz", hash = "sha256:be3db0be6c81fa84742000b89a81c016d70ae66a7ccb620cdef592b1f1a6aaa4"}, @@ -1151,8 +1143,8 @@ pyflakes = [ {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, ] pylint = [ - {file = "pylint-2.13.4-py3-none-any.whl", hash = "sha256:8672cf7441b81410f5de7defdf56e2d559c956fd0579652f2e0a0a35bea2d546"}, - {file = "pylint-2.13.4.tar.gz", hash = "sha256:7cc6d0c4f61dff440f9ed8b657f4ecd615dcfe35345953eb7b1dc74afe901d7a"}, + {file = "pylint-2.13.5-py3-none-any.whl", hash = "sha256:c149694cfdeaee1aa2465e6eaab84c87a881a7d55e6e93e09466be7164764d1e"}, + {file = "pylint-2.13.5.tar.gz", hash = "sha256:dab221658368c7a05242e673c275c488670144123f4bd262b2777249c1c0de9b"}, ] pynacl = [ {file = "PyNaCl-1.5.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:401002a4aaa07c9414132aaed7f6836ff98f59277a234704ff66878c2ee4a0d1"}, @@ -1167,8 +1159,8 @@ pynacl = [ {file = "PyNaCl-1.5.0.tar.gz", hash = "sha256:8ac7448f09ab85811607bdd21ec2464495ac8b7c66d146bf545b0f08fb9220ba"}, ] pyparsing = [ - {file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"}, - {file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"}, + {file = "pyparsing-3.0.8-py3-none-any.whl", hash = "sha256:ef7b523f6356f763771559412c0d7134753f037822dad1b16945b7b846f7ad06"}, + {file = "pyparsing-3.0.8.tar.gz", hash = "sha256:7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954"}, ] pytest = [ {file = "pytest-7.1.1-py3-none-any.whl", hash = "sha256:92f723789a8fdd7180b6b06483874feca4c48a5c76968e03bb3e7f806a1869ea"}, @@ -1240,9 +1232,6 @@ tzdata = [ {file = "tzdata-2022.1-py2.py3-none-any.whl", hash = "sha256:238e70234214138ed7b4e8a0fab0e5e13872edab3be586ab8198c407620e2ab9"}, {file = "tzdata-2022.1.tar.gz", hash = "sha256:8b536a8ec63dc0751342b3984193a3118f8fca2afe25752bb9b7fffd398552d3"}, ] -unittest = [ - {file = "unittest2-0.0.0.tar.gz", hash = "sha256:1b492484bea7f68abda5fcc61412e77b6a105e5842355d630f8b75f01add3555"}, -] urllib3 = [ {file = "urllib3-1.26.9-py2.py3-none-any.whl", hash = "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14"}, {file = "urllib3-1.26.9.tar.gz", hash = "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"}, diff --git a/pyproject.toml b/pyproject.toml index dab9401..0db8714 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,6 @@ psutil = "^5.9.0" paramiko = "^2.10.3" requests = "^2.27.1" rpyc = "^5.1.0" -unittest = "^0.0" [tool.poetry.dev-dependencies] black = "^22.3.0" @@ -30,9 +29,14 @@ taskipy = "^1.10.1" pytest-codecov = "^0.4.0" coverage = "^6.3.2" +[tool.pytest.ini_options] +pythonpath = [ + ".", "gcc_exec", +] + [tool.taskipy.tasks] lint = { cmd = "black gcc_exec socket_service --check;flake8 gcc_exec socket_service --ignore=E501,W503;pylint gcc_exec socket_service", help = "Run the black checks for source code format" } -test = { cmd = "pytest --cov gcc_exec/tests --cov-report xml:coverage.xml", help = "Run the test suite to ensure code correctness" } +test = { cmd = "pytest --cov gcc_exec --cov-report xml:coverage.xml", help = "Run the test suite to ensure code correctness" } [build-system] requires = ["poetry-core>=1.0.0"]