Selfie
Loading...
Searching...
No Matches
pytest_selfie.plugin.DiskStoragePytest Class Reference
Inheritance diagram for pytest_selfie.plugin.DiskStoragePytest:
selfie_lib.SnapshotSystem.DiskStorage

Public Member Functions

 __init__ (self, "SnapshotFileProgress" progress, str testname)
 
Optional["Snapshot"] read_disk (self, str sub, "CallStack" call)
 
 write_disk (self, "Snapshot" actual, str sub, "CallStack" call)
 
 keep (self, Optional[str] sub_or_keep_all)
 

Protected Member Functions

str _suffix (self, str sub)
 

Protected Attributes

 _testname
 

Detailed Description

Definition at line 261 of file plugin.py.

Constructor & Destructor Documentation

◆ __init__()

pytest_selfie.plugin.DiskStoragePytest.__init__ (   self,
"SnapshotFileProgress"  progress,
str  testname 
)

Definition at line 262 of file plugin.py.

262 def __init__(self, progress: "SnapshotFileProgress", testname: str):
263 self.__progress = progress
264 self._testname = testname
265

Member Function Documentation

◆ _suffix()

str pytest_selfie.plugin.DiskStoragePytest._suffix (   self,
str  sub 
)
protected

Definition at line 283 of file plugin.py.

283 def _suffix(self, sub: str) -> str:
284 return f"/{sub}" if sub else ""
285
286

◆ keep()

pytest_selfie.plugin.DiskStoragePytest.keep (   self,
Optional[str]  sub_or_keep_all 
)

Reimplemented from selfie_lib.SnapshotSystem.DiskStorage.

Definition at line 278 of file plugin.py.

278 def keep(self, sub_or_keep_all: Optional[str]):
279 self.__progress.keep(
280 self._testname, self._suffix(sub_or_keep_all) if sub_or_keep_all else None
281 )
282

◆ read_disk()

Optional["Snapshot"] pytest_selfie.plugin.DiskStoragePytest.read_disk (   self,
str  sub,
"CallStack"  call 
)

Reimplemented from selfie_lib.SnapshotSystem.DiskStorage.

Definition at line 266 of file plugin.py.

266 def read_disk(self, sub: str, call: "CallStack") -> Optional["Snapshot"]: # noqa: ARG002
267 return self.__progress.read(self._testname, self._suffix(sub))
268

◆ write_disk()

pytest_selfie.plugin.DiskStoragePytest.write_disk (   self,
"Snapshot"  actual,
str  sub,
"CallStack"  call 
)

Reimplemented from selfie_lib.SnapshotSystem.DiskStorage.

Definition at line 269 of file plugin.py.

269 def write_disk(self, actual: "Snapshot", sub: str, call: "CallStack"):
270 self.__progress.write(
271 self._testname,
272 self._suffix(sub),
273 actual,
274 call,
275 self.__progress.system.layout,
276 )
277

Member Data Documentation

◆ _testname

pytest_selfie.plugin.DiskStoragePytest._testname
protected

Definition at line 264 of file plugin.py.


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