Skip to content

✨ Added support for the StrictInt and StrictFloat types #74

Merged
yezz123 merged 4 commits into
mainfrom
fix/generator
Dec 19, 2022
Merged

✨ Added support for the StrictInt and StrictFloat types #74
yezz123 merged 4 commits into
mainfrom
fix/generator

Conversation

@yezz123

@yezz123 yezz123 commented Dec 19, 2022

Copy link
Copy Markdown
Owner
  • Added support for the StrictInt and StrictFloat types from the strict-types library.
  • Added a strict_types flag to the generate function to control whether strict types are used for integers and floats.
  • Added unit tests for the new strict types and the strict_types flag.

The StrictInt and StrictFloat types are subclasses of int and float, respectively, that provide additional validation for their values. They are used in the same way as the built-in int and float types, but will raise a TypeError if an invalid value is assigned to them.

The strict_types flag is a boolean parameter added to the generate function. If strict_types is True, the _get_value function will use the StrictInt and StrictFloat types instead of int and float when generating random numbers.

This pull request also includes unit tests for the new strict types and the strict_types flag to ensure that they are working as expected.

@yezz123 yezz123 added enhancement New feature or request refactoring labels Dec 19, 2022
@yezz123 yezz123 self-assigned this Dec 19, 2022
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (e8bf271) compared to base (8d243f6).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #74   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        23    +1     
  Lines          852       944   +92     
=========================================
+ Hits           852       944   +92     
Impacted Files Coverage Δ
ormdantic/generator/_lazy.py 100.00% <100.00%> (ø)
ormdantic/handler/__init__.py 100.00% <100.00%> (ø)
ormdantic/handler/random.py 100.00% <100.00%> (ø)
ormdantic/types/__init__.py 100.00% <100.00%> (ø)
ormdantic/types/base.py 100.00% <100.00%> (ø)
tests/test_generator.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yezz123 yezz123 changed the title 🎨 Refactor the functions of generator ✨ Added support for the StrictInt and StrictFloat types Dec 19, 2022
@yezz123 yezz123 merged commit 34ec025 into main Dec 19, 2022
@yezz123 yezz123 deleted the fix/generator branch December 19, 2022 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants