Skip to main content

Extra for ArsenalQA package

Project description

Quick start

ArsenalQA is a framework that helps to abstract QA functional tests from developers realisation in ORM style.

Model your data - Models helps you to change and test your data quicker.

Make you transports abstract - it helps you to add them faster.

Make relations between models by transports or other models - it helps your colleagues to understand your code easily.

Instalation:

$ pip install arsenalqa[http]

Lets make our first example:

from arsenalqa.fields import Field
from arsenalqa.models import Model
from arsenalqa.transports import TransportManager
from arsenalqa.transports.http import Http


class MyModel(Model):

    http: Http = TransportManager(Http, url='https://jsonplaceholder.typicode.com/todos/{id}')

    id = Field()
    user_id = Field(name='UserId')
    title = Field()
    completed = Field()

Our model was created.

Now you can:

print(MyModel.http.get())  # get list of todos models
>>> I:[{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False}, {'userId': 1, 'id': 2, 'title': 'quis ut nam facilis et officia qui', 'completed': False}

my_model = MyModel()  # new instance of my model
my_model.id = 1
response_model = my_model.http.get()  # get single instance from web
print(response_model)  # model from web
>>> M:{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False}

print(response_model.id == my_model.id)
>>> True

# Lets fill new instance of our model and post it to the web
new_model = MyModel()
new_model.user_id = 1
new_model.title = 'My new title'
new_model.completed = False

new_created_model = new_model.http.post()  # Send via http POST method
print(new_created_model)  # Response wrapped in new model. Has filled field id.
>>> M:{'id': 201}
print(new_model == new_created_model)  # False because, response model contains only id field.
>>> False

# Lets get list of todos from web, and filter it by completed status
print(MyModel.http.get().filter_by_attrs(completed=False))
>>> I:[{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False}, {'userId': 1, 'id': 2, 'title': 'quis ut nam facilis et officia qui', 'completed': False},...

# Lets get list of todos from web, and filter single unique model by id
first_todo = MyModel.http.get().unique_by_attrs(id=1)
print(first_todo)
>>> M:{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False}

# Lets request again from response model, and get title attribute from response modle
print(first_todo.http.get().title)
>>> delectus aut autem

Congrats! Now you can start learning this framework. You can find next steps inside the docs directory!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

arsenalqa_amqp-2020.0.2-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file arsenalqa_amqp-2020.0.2-py3-none-any.whl.

File metadata

  • Download URL: arsenalqa_amqp-2020.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.5

File hashes

Hashes for arsenalqa_amqp-2020.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d6099535cd733b2b42bc41b0a7e83bcde9fb445245308bf8b35cd62dbe7535d0
MD5 01714905671afbc97145c7013aa7b9fa
BLAKE2b-256 814474676e71f61003068c51e9ec9fb0303236d391d4e19faa0be3d9111d8480

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