Skip to main content

Test Storytelling

Project description

https://github.com/lemoncheesecake/lemoncheesecake/blob/master/doc/_static/logo.png?raw=true

lemoncheesecake: Test Storytelling

https://github.com/lemoncheesecake/lemoncheesecake/actions/workflows/tests.yml/badge.svg https://codecov.io/gh/lemoncheesecake/lemoncheesecake/branch/master/graph/badge.svg https://img.shields.io/pypi/v/lemoncheesecake.svg https://img.shields.io/pypi/pyversions/lemoncheesecake.svg

lemoncheesecake is an end-to-end test framework for Python that brings trust around test results. It allows test developers to be very explicit about what their tests really do with logging, matchers, file attachments, etc..

Here is a test example:

import json
import requests

import lemoncheesecake.api as lcc
from lemoncheesecake.matching import *

URL  = "https://api.github.com/orgs/lemoncheesecake"

@lcc.suite("Github tests")
class github:
    @lcc.test("Test Organization end-point")
    def organization(self):
        lcc.set_step("Get lemoncheesecake organization information")
        lcc.log_info("GET %s" % URL)
        resp = requests.get(URL)
        require_that("HTTP code", resp.status_code, is_(200))
        data = resp.json()
        lcc.log_info("Response\n%s" % json.dumps(data, indent=4))

        lcc.set_step("Check API response")
        check_that_in(
            data,
            "type", is_("Organization"),
            "id", is_integer(),
            "description", is_not_none(),
            "login", is_(present()),
            "created_at", match_pattern("^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$"),
            "has_organization_projects", is_true(),
            "followers", is_(greater_than_or_equal_to(0)),
            "following", is_(greater_than_or_equal_to(0)),
            "repos_url", ends_with("/repos"),
            "issues_url", ends_with("/issues"),
            "events_url", ends_with("/events"),
            "hooks_url", ends_with("/hooks"),
            "members_url", ends_with("/members{/member}"),
            "public_members_url", ends_with("/public_members{/member}")
        )

And here are the corresponding test results:

test results

NB: in real test code, you’d better use lemoncheesecake-requests when doing HTTP / REST API testing.

Features

  • Advanced test hierarchies using suites, tests and nested suites

  • Test description and metadata: tags, properties (key=value associations) and links

  • Support for test filtering

  • Multiple reporting flavors built-in: HTML, JSON, XML, JUnit, ReportPortal, Slack notifications

  • BDD support using behave

  • Test parallelization

  • Rich CLI toolbox

lemoncheesecake is compatible with Python 3.8-3.12.

Installation

lemoncheesecake can be installed through pip:

$ pip install lemoncheesecake

For more details about installing lemoncheesecake with the non-default reporting backends, see here.

Documentation

The documentation is available on http://docs.lemoncheesecake.io.

The lemoncheesecake ecosystem

Contact

Bugs and improvement ideas are welcomed in tickets. A Google Groups forum is also available for discussions about lemoncheesecake: https://groups.google.com/forum/#!forum/lemoncheesecake.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

lemoncheesecake-1.15.0.tar.gz (484.1 kB view details)

Uploaded Source

File details

Details for the file lemoncheesecake-1.15.0.tar.gz.

File metadata

  • Download URL: lemoncheesecake-1.15.0.tar.gz
  • Upload date:
  • Size: 484.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.6 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for lemoncheesecake-1.15.0.tar.gz
Algorithm Hash digest
SHA256 da93676ab46cb7f6970a70cabc6973078015d7cdc9374f2483a5ce5f7e8ac4c9
MD5 16b5f89e31e81bf88788b89a995b6f91
BLAKE2b-256 ea3243f5cd95817ecd690201bd38fcf7610dd7dcaf757316ec2f0d1437108f3b

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