Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>>> assert_that(Report,
... has_test_case('test_case_without_container',
... has_container(Report,
... has_before('before_fixture')
... )
... )
... ) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
AssertionError: ...
Expected: ...
but: ...
"""
return HasContainer(report, *matchers)
>>> assert_that(Report,
... has_same_container('first_test_case', 'second_test_case')
... )
>>> assert_that(Report,
... has_same_container('second_test_case', 'third_test_case')
... ) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
AssertionError: ...
Expected: ...
but: ...
"""
return HasSameContainer(*args)
def has_only_n_test_cases(name, num, *matchers):
return has_property('test_cases',
ContainsExactly(num,
all_of(
any_of(
has_entry('fullName', ends_with(name)),
has_entry('name', ends_with(name))
),
*matchers
)
def has_only_testcases(*matchers):
return HasOnlyTetcases(*matchers)