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
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
Built Distribution
Hashes for ib110hw_testing-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56fbfc8565937a203213102e54b55b88ed3eb6144d3c7aac4042b0fed6b940e1 |
|
MD5 | 5a4c9423db540c2f2d181297510dfb76 |
|
BLAKE2b-256 | 335c0f143a121f36919eb03017702be1e7c05859d744f7bc766f932b12beaf59 |