Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add end start and contains support for matchers. Fix import order. Add not_empty_string and extra main matchers #12

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

MartinGotelli
Copy link
Owner

Add support for matchers in the is_string matcher:

def test_is_string_with_created_datetime_matcher():
    now = datetime.now()
    date_format = "%Y-%m-%d %H:%M:%S"
    now_string = now.strftime(date_format)
    assert now_string == is_datetime_string(date_format)
    start_text = f"{now_string}: Martín created this awesome test"
    assert start_text == is_string(starts_with=is_datetime_string(date_format))
    end_text = f"Someone decided to add some extra text to the end on: {now_string}"
    assert end_text == is_string(ends_with=is_datetime_string(date_format))
    contains_text = f"I once ate a sandwich, was on {now_string}, or maybe two"
    assert contains_text == is_string(contains=is_datetime_string(date_format))
    assert start_text == is_string(contains=is_datetime_string(date_format))
    assert end_text == is_string(contains=is_datetime_string(date_format))

Add not_empty_string, is_int, is_float, is_iso8601_date, is_iso8601_datetime, is_iso8601_time matchers

…r. Add not_empty_string and extra main matchers
@MartinGotelli MartinGotelli merged commit d63dc98 into main Aug 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant