MCPcopy
hub / github.com/cool-RR/PySnooper / SourcePathEntry

Class SourcePathEntry

tests/utils.py:239–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237 )
238
239class SourcePathEntry(_BaseValueEntry):
240 def __init__(self, source_path=None, source_path_regex=None, prefix=''):
241 _BaseValueEntry.__init__(self, prefix=prefix)
242 if source_path is not None:
243 assert source_path_regex is None
244
245 self.source_path = source_path
246 self.source_path_regex = (None if source_path_regex is None else
247 re.compile(source_path_regex))
248
249 _preamble_pattern = re.compile(
250 r"""^Source path$"""
251 )
252
253 def _check_preamble(self, preamble):
254 return bool(self._preamble_pattern.match(preamble))
255
256 def _check_content(self, source_path):
257 if self.source_path is not None:
258 return source_path == self.source_path
259 elif self.source_path_regex is not None:
260 return self.source_path_regex.match(source_path)
261 else:
262 return True
263
264
265class _BaseEventEntry(_BaseEntry):

Callers 15

test_string_ioFunction · 0.85
test_relative_timeFunction · 0.85
test_thread_infoFunction · 0.85
test_multi_thread_infoFunction · 0.85
test_callableFunction · 0.85
test_watchFunction · 0.85
test_watch_explodeFunction · 0.85
test_variables_classesFunction · 0.85
test_long_variableFunction · 0.85

Calls

no outgoing calls

Tested by 15

test_string_ioFunction · 0.68
test_relative_timeFunction · 0.68
test_thread_infoFunction · 0.68
test_multi_thread_infoFunction · 0.68
test_callableFunction · 0.68
test_watchFunction · 0.68
test_watch_explodeFunction · 0.68
test_variables_classesFunction · 0.68
test_long_variableFunction · 0.68