Skip to main content

Class for autotests GoogleAppEngine python3 app.

Project description

Class for autotests GoogleAppEngine Python3 app.

GitHub Workflow Status GitHub Workflow Status Codacy Badge Codacy Badge

Install

pip install test-helper-gae3

Usage in tests

import unittest
from google.appengine.ext import ndb
from test_helper_gae3 import TestGae3


class ModelTest(ndb.Model):
    name = ndb.StringProperty(default='')


class TestCase(unittest.TestCase, TestGae3):

    def setUp(self):
        super().setUp()

        # For using queues names other then 'default', root_path dir must contain file
        # 'queue.yaml' (or 'queue.yml') with correct queues definition.
        # If root_path set to None, only 'default' queue is available.
        TestGae3.set_up(self, 'path/to/folder/with/queue.yaml')  # activate GAE testbed

    def tearDown(self):
        TestGae3.tear_down(self)  # deactivate GAE testbed
        super().tearDown()

    def test_record_count(self):
        self.check_db_tables([
          (ModelTest, 0),  # no records in ModelTest
        ])

        ModelTest().put()

        self.tester.check_db_tables([
          (ModelTest, 1),  # one record in ModelTest
        ])

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

test_helper_gae3-1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

test_helper_gae3-1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file test_helper_gae3-1.2.tar.gz.

File metadata

  • Download URL: test_helper_gae3-1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for test_helper_gae3-1.2.tar.gz
Algorithm Hash digest
SHA256 0dd8bdbd8d6b336b57d32cc363371df4a1aac3b8e0dc286d5aaf5b6f5b35b15e
MD5 99c609b2d49aef4ab8f50e113b12fc6d
BLAKE2b-256 d1fe99c510563fb3fb4fbe646256b01ef22fbac37bfab7f73f115eb4971f4e69

See more details on using hashes here.

File details

Details for the file test_helper_gae3-1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for test_helper_gae3-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94f7a5faef55eacdaf7d50dbcc11cf9d32ebbd9e87af0790d68c635cf5e808e9
MD5 aa67250db70f6b5f944862e901318925
BLAKE2b-256 58b1bb0a4c786eeb8af8105807fd1b0704f08c250b67fc1299f7bbeb33634158

See more details on using hashes here.

Supported by

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