Selfie
Loading...
Searching...
No Matches
pytest_selfie.plugin.FSImplementation Class Reference
Inheritance diagram for pytest_selfie.plugin.FSImplementation:
selfie_lib.FS.FS

Public Member Functions

Exception assert_failed (self, message, expected=None, actual=None)
 
- Public Member Functions inherited from selfie_lib.FS.FS
bool file_exists (self, TypedPath typed_path)
 
T file_walk (self, TypedPath typed_path, Callable[[Iterator[TypedPath]], T] walk)
 
str file_read (self, typed_path)
 
 file_write (self, typed_path, str content)
 
bytes file_read_binary (self, TypedPath typed_path)
 
 file_write_binary (self, TypedPath typed_path, bytes content)
 

Detailed Description

Definition at line 35 of file plugin.py.

Member Function Documentation

◆ assert_failed()

Exception pytest_selfie.plugin.FSImplementation.assert_failed (   self,
  message,
  expected = None,
  actual = None 
)

Reimplemented from selfie_lib.FS.FS.

Definition at line 36 of file plugin.py.

36 def assert_failed(self, message, expected=None, actual=None) -> Exception:
37 if expected is None and actual is None:
38 return AssertionError(message)
39
40 expected_str = self.__nullable_to_string(expected, "")
41 actual_str = self.__nullable_to_string(actual, "")
42
43 if not expected_str and not actual_str and (expected is None or actual is None):
44 on_null = "(null)"
45 return self.__comparison_assertion(
46 message,
47 self.__nullable_to_string(expected, on_null),
48 self.__nullable_to_string(actual, on_null),
49 )
50 else:
51 return self.__comparison_assertion(message, expected_str, actual_str)
52

The documentation for this class was generated from the following file: