Fixed unit tests !
This commit is contained in:
@@ -72,6 +72,12 @@ class EndsWith(AttrPredicate):
|
|||||||
|
|
||||||
class Contains(AttrPredicate):
|
class Contains(AttrPredicate):
|
||||||
def __init__(self, *value, _word=False):
|
def __init__(self, *value, _word=False):
|
||||||
|
"""
|
||||||
|
Initializes the instance with the given value and optional private attribute `_word`.
|
||||||
|
|
||||||
|
:param value:
|
||||||
|
:param _word: Matches the entire word if True, otherwise matches any substring.
|
||||||
|
"""
|
||||||
super().__init__(value)
|
super().__init__(value)
|
||||||
self._word = _word
|
self._word = _word
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ class TestProfilerRender:
|
|||||||
|
|
||||||
trace_list = profiler_control._mk_trace_list()
|
trace_list = profiler_control._mk_trace_list()
|
||||||
|
|
||||||
cmd_spans = find(trace_list, Span("NavigateCell", cls=Contains("mf-profiler-cmd")))
|
cmd_spans = find(trace_list, Span("NavigateCell", cls=Contains("mf-profiler-cmd", _word=True)))
|
||||||
assert len(cmd_spans) == 1, "Command name should appear exactly once in the trace list"
|
assert len(cmd_spans) == 1, "Command name should appear exactly once in the trace list"
|
||||||
|
|
||||||
ts_spans = find(trace_list, Span(ts_expected, cls=Contains("mf-profiler-ts")))
|
ts_spans = find(trace_list, Span(ts_expected, cls=Contains("mf-profiler-ts")))
|
||||||
|
|||||||
Reference in New Issue
Block a user