diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d09a95b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Static Code Analysis with pylint + run: | + pylint BuyingModule/ DaoModule/ EmailModule/ ScraperModule/ TimeModule/ TokenManagementModule/ UI_Module/ main.py transactions.py + - name: Static Code Analysis with flake8 + run: | + flake8 BuyingModule/ DaoModule/ EmailModule/ ScraperModule/ TimeModule/ TokenManagementModule/ UI_Module/ main.py transactions.py + - name: Static Type Checking with mypy + run: | + mypy BuyingModule/ DaoModule/ EmailModule/ ScraperModule/ TimeModule/ TokenManagementModule/ UI_Module/ main.py transactions.py + - name: Run Unit Tests + run: | + pytest \ No newline at end of file diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..0bd3b01 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,6 @@ +[MASTER] +ignore=venv +max-line-length=100 + +[MESSAGES CONTROL] +disable=C0114,C0115,C0116 # Disable missing module, class, function docstrings \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d32496f..581cc49 100644 --- a/requirements.txt +++ b/requirements.txt @@ -63,3 +63,8 @@ websockets==9.1 Werkzeug==2.0.2 wsproto==1.0.0 zipp==3.6.0 + +pylint==2.15.10 +flake8==4.0.1 +mypy==0.961 +pytest==7.2.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..61ff1c4 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,9 @@ +[flake8] +max-line-length = 100 +exclude = venv,.git,__pycache__ + +[mypy] +python_version = 3.8 +disallow_untyped_calls = True +disallow_untyped_defs = True +ignore_missing_imports = True \ No newline at end of file diff --git a/test.py b/test.py index 9bcda6c..f936f5d 100644 --- a/test.py +++ b/test.py @@ -27,4 +27,19 @@ # print(values) # receiver = Receiver() -# receiver.receive_data([{"login": "mykola.kurenkov@data-ox.com", "password": "TestTest123$"}], [1,], buy_nft) \ No newline at end of file +# receiver.receive_data([{"login": "mykola.kurenkov@data-ox.com", "password": "TestTest123$"}], [1,], buy_nft) + +import pytest + +@pytest.fixture +def setup(): + # Setup code if necessary + pass + +def test_buy_transaction(): + # Implement test for WaxBloksIoTransactions.buy + assert True # Replace with actual assertions + +def test_deposit_transaction(): + # Implement test for WaxBloksIoTransactions.deposit + assert True # Replace with actual assertions \ No newline at end of file