Skip to main content

Backend automation framework. Automation is easy.

Project description

unittest passing codecov badge pypi version

Install

According to your version of pip type in console

pip3 install pycamel

or

pip install pycamel

Quick start

  • First, init CamelConfig in the main tests/conftest.py file

from pycamel import CamelConfig

CamelConfig(host='https://localhost/')

This host will be used as the main project url.

For example, if you have a lot of services in your infrastructure

  • data-service

  • image-service

all of them will have the same host, but different paths according to the services and their api versions

We recommend you to create a separate sub folder for each service under the tests folder and init API maker for them

tests/data_service/conftest.py

from pycamel import RouterMaker

data_service_maker_v1 = RouterMaker('/data-service/v1')

The same code should be used for another services. For cases with different API versions (v1, v2, etc.) it is up to you to create different folders or to make one for both of them but with a router maker for each version.

So, for now we are ready to make some tests ^_^ Let’s test endpoint on the data-service.

Add some code into our tests/data_service/conftest.py

tests/data_service/conftest.py

import pytest
from pycamel import RouterMaker

data_service_maker_v1 = RouterMaker('/data-service/v1')

cats_statistic = data_service_maker_v1.make_router('/cats-statistic')

@pytest.fixture(scope='session')
def statistic_route():
    return cats_statistic

In the tests below we will check only status codes. More information about the validation you can find in the example project or in the official documentation.

Create a file for our tests. tests/data_service/test_statistic.py

import pytest

def test_getting_statistic(statistic_route):
    response = statistic_route.get()
    response.assert_status_code([200])


@pytest.mark.parametrize("page", [1, 2, 3])
def test_getting_statistic_with_pagination(page):
    response = statistic_route.set_filters({"page": page}).get()
    response.assert_status_code([200])

Examples

In the project you can find examples of using the framework in test cases.

  • Pylint

    Check if your code doesn’t have any pylint errors.

  • Submit your pull request

    In a pull request, describe your feature as clearly as possible and submit it, please.

Learn automation with us

Here you can find some youtube lessons about automation on python with a common pytest framework and with pycamel. Enjoy it :)

https://www.youtube.com/c/SolveMeChannel

It is ready to use backend API where you can practice with automation case writing.

https://send-request.me/

Contact us

Email: solveme.solutions@gmail.com

Telegram: https://t.me/automation_testing_with_solveme

Donation

For people who would like to support us. God bless U ^_^

BSC20

0x3EC81929e06950322d5125d8e6CA834F3d9B21f8

DOGE | BNB | CAKE | ADA | BUSD | TRX | MATIC | AVAX | ATOM | DIA | DOT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycamel-1.0.3.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycamel-1.0.3-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file pycamel-1.0.3.tar.gz.

File metadata

  • Download URL: pycamel-1.0.3.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pycamel-1.0.3.tar.gz
Algorithm Hash digest
SHA256 733e4476f0d7f9ce45a50ff0139d52b68ebc653c4c26edd74e7c40402047ffcf
MD5 c4a2fd796b0bdcabc2224600a2f8bcae
BLAKE2b-256 1b5650c779f247205f1386cea16e928fbd101089559aece92fe7df4ad3b6d99c

See more details on using hashes here.

File details

Details for the file pycamel-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pycamel-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pycamel-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 93ba3a00e387c6e8c98dc48cdeb1c612587ad453c69e947f31d2e82dde696c0d
MD5 c6e4676f94450f845d59207784dab84e
BLAKE2b-256 3e3805d84dd088591555809c9ae8f0e20c601e74cbeb40eda9ac05cebe0867f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page