From: Sergey Matveev Date: Sat, 30 Nov 2024 18:34:54 +0000 (+0300) Subject: Move everything-strategy as it will be used X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c894064d0e3b565523148b39d53988ffa8093b7d5747a948f8443794271ed498;p=keks.git Move everything-strategy as it will be used --- diff --git a/pyac/tests/strategies.py b/pyac/tests/strategies.py index 2f0aa64..6d18d12 100644 --- a/pyac/tests/strategies.py +++ b/pyac/tests/strategies.py @@ -2,8 +2,11 @@ from hypothesis.strategies import binary from hypothesis.strategies import booleans from hypothesis.strategies import characters from hypothesis.strategies import datetimes +from hypothesis.strategies import deferred +from hypothesis.strategies import dictionaries from hypothesis.strategies import integers from hypothesis.strategies import just +from hypothesis.strategies import lists from hypothesis.strategies import none from hypothesis.strategies import one_of from hypothesis.strategies import text @@ -29,3 +32,8 @@ any_st = one_of( uuids(), datetimes(), ) +everything_st = deferred( + lambda: any_st | + lists(everything_st, max_size=4) | + dictionaries(mapkey_st, everything_st, max_size=4) +) diff --git a/pyac/tests/test_everything.py b/pyac/tests/test_everything.py index 66474e2..86b895b 100644 --- a/pyac/tests/test_everything.py +++ b/pyac/tests/test_everything.py @@ -2,22 +2,11 @@ from typing import Any from unittest import TestCase from hypothesis import given -from hypothesis.strategies import deferred -from hypothesis.strategies import dictionaries -from hypothesis.strategies import lists from pyac import dumps from pyac import loads -from tests.strategies import any_st from tests.strategies import junk_st -from tests.strategies import mapkey_st - - -everything_st = deferred( - lambda: any_st | - lists(everything_st, max_size=4) | - dictionaries(mapkey_st, everything_st, max_size=4) -) +from tests.strategies import everything_st class TestEverything(TestCase):