Skip to main content

This library provides a set of base test cases that can be mixed into your existing test cases.

They provide additional features to sandbox each test (by clearing the DataStore, Memcache, etc) and also add in additional assert style statements.

MailTestCase example:

import unittest
from gaetestbed import MailTestCase

class MyTestCase(unittest.TestCase, MailTestCase):
    def test_email_sent(self):
        send_email_to('test@example.org') # Some method that sends e-mail...
        self.assertEmailSent(to='test@example.org')
        self.assertEqual(len(self.get_sent_messages()), 1)

MemcacheTestCase example:

import unittest
from gaetestbed import MemcacheTestCase

class MyTestCase(unittest.TestCase, MemcacheTestCase):
    def test_memcache_gets_hit(self):
        self.assertMemcacheItems(0)
        self.assertMemcacheHits(0)

        add_to_memcache('something', 'something') # Add something to memcache somehow...
        self.assertMemcacheItems(1)
        self.assertMemcacheHits(0)

        get_page('/page_that_hits_memcache/')
        self.assertMemcacheItems(1)
        self.assertMemcacheHits(1)

Download files

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

Source Distribution

gaetestbed-0.12.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file gaetestbed-0.12.tar.gz.

File metadata

  • Download URL: gaetestbed-0.12.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gaetestbed-0.12.tar.gz
Algorithm Hash digest
SHA256 a3790983d08c2f9c2aa9f3f2a348f37c801dd89cfb19fb976a048cdf10fac0e6
MD5 f969c1e6b9c6638b10d7dde17f3ffd8d
BLAKE2b-256 a4496cde6befa18ace00bf7e1ad12fe1802f5627aff6957f60cd202f72c019e9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.12 This release

1 file

0.1dev-r11

0.1dev-r10

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page