Skip to main content

unitstorm

Introduction

Storm is a fast, small and powerful object-relational mapper. Try it to use in db-aware applications.

Effective unit-testing DB-models needed:

  • easy access to testing-DB inside testcases

  • setting up testing-DB before each test (and tear down after)

To help this unitstorm provides class ModelTestCase, that can be used both in unittest and nosetest testing frameworks.

Simple example

from unitstorm import ModelTestCase
from os import path

import models as model # models define somewhere else

class TestMyModel(ModelTestCase):
    dburi = 'postgres://test:test@localhost/test'

    fixtures = path.join(path.dirname(__file__), 'fixtures')

    fixture_setup = 'create.sql', 'filldata.sql'
    fixture_teardown = 'drop.sql'

    sql_setup = 'INSERT INTO my_model (id, name) VALUES (1, "foo");',\
        'INSERT INTO my_model (id, name) VALUES (2, "bar");'
    sql_teardown = 'DELETE FROM my_model WHERE id = 1;'

    def test_stub(self):
        assert self.store.get(model.MyModel, 1).name == "foo"

TODO more description (look sources)

dburi

db

store

fixtures

fixture_setup

fixture_teardown

sql_setup

sql_teardown

Execution order: fixture_setup, sql_setup, test, sql_teardown, fixture_teardown

Metadata

Release files for unitstorm 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unitstorm 0.1.1
File Size Uploaded Provenance Actions
unitstorm-0.1.1.tar.gz 4.3 kB Without provenance Details for unitstorm-0.1.1.tar.gz

Release files / unitstorm-0.1.1.tar.gz

Download URL unitstorm-0.1.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
aeeebf1ea2046c3fa62cd450319ce2b40e94c9b15ba3f722852ddb8f7e2d4536
BLAKE2b-256 checksum
How to use checksums
049cc9eec961d4bffaf4f4fb8a5dacc1812c9dc87da450d673b0a6eb3f649c10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for unitstorm 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

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