Skip to main content

Package used for testing homework assignments in the IB110 course at FI MUNI.

Project description

This library was created for the course IB110 - Introduction to Informatics at MUNI FI. It builds on top of the ib110hw and the hypothesis libraries.

Setup

Python version required for this library is >=3.6. It can be installed using pip like so: pip install ib110hw_testing

Using venv to install the library is recommended as it has some dependencies (ib110hw, exrex, hypothesis).

Modules

Testing

The module testing contains some predefined strategies which can be used with the hypothesis library.

Example Use-case

Below code shows a simple example of strategies used with tests.

from hypothesis import given
from ib110hw.automaton.dfa import DFA
from ib110hw_testing.testing.strategies import dfas, strings_from_regex
from typing import Set

@given(
    dfas(alphabet={"a", "b", "c"}),
    strings_from_regex(regex="[abc]*")
)
def test(dfa: DFA, strings: Set[str])
    ...

Transformation

The module transformation contains implementations of some algorithms which can be used to transform automata.

Example Use-case

Below code shows a simple example of automata comparison.

from ib110hw.automaton.dfa import DFA
from ib110hw.automaton.nfa import NFA
from ib110hw_testing.transformation.transformation import compare_automata

nfa: NFA = NFA(...) # an arbitrary NFA
dfa: DFA = DFA(...) # an arbitrary DFA

compare_automata(nfa, dfa) # returns True/False

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

ib110hw_testing-0.1.11.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

ib110hw_testing-0.1.11-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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