Selfie
Loading...
Searching...
No Matches
selfie_lib.SelfieImplementations.DiskSelfie Class Reference
Inheritance diagram for selfie_lib.SelfieImplementations.DiskSelfie:
selfie_lib.SelfieImplementations.FluentFacet selfie_lib.SelfieImplementations.ReprSelfie selfie_lib.SelfieImplementations.BinarySelfie selfie_lib.SelfieImplementations.StringSelfie

Public Member Functions

 __init__ (self, Snapshot actual, DiskStorage disk)
 
"DiskSelfie" to_match_disk (self, str sub="")
 
"DiskSelfie" to_match_disk_TODO (self, str sub="")
 
"StringFacet" facet (self, str facet)
 
"StringFacet" facets (self, *str facets)
 
"BinaryFacet" facet_binary (self, str facet)
 

Public Attributes

 actual
 
 disk
 

Detailed Description

Definition at line 63 of file SelfieImplementations.py.

Constructor & Destructor Documentation

◆ __init__()

selfie_lib.SelfieImplementations.DiskSelfie.__init__ (   self,
Snapshot  actual,
DiskStorage  disk 
)

Reimplemented in selfie_lib.SelfieImplementations.StringSelfie, selfie_lib.SelfieImplementations.BinarySelfie, and selfie_lib.SelfieImplementations.ReprSelfie.

Definition at line 64 of file SelfieImplementations.py.

64 def __init__(self, actual: Snapshot, disk: DiskStorage):
65 self.actual = actual
66 self.disk = disk
67

Member Function Documentation

◆ facet()

"StringFacet" selfie_lib.SelfieImplementations.DiskSelfie.facet (   self,
str  facet 
)
Extract a single facet from a snapshot in order to do an inline snapshot.

Reimplemented from selfie_lib.SelfieImplementations.FluentFacet.

Definition at line 87 of file SelfieImplementations.py.

87 def facet(self, facet: str) -> "StringFacet":
88 return StringSelfie(self.actual, self.disk, [facet])
89

◆ facet_binary()

"BinaryFacet" selfie_lib.SelfieImplementations.DiskSelfie.facet_binary (   self,
str  facet 
)

Reimplemented from selfie_lib.SelfieImplementations.FluentFacet.

Definition at line 93 of file SelfieImplementations.py.

93 def facet_binary(self, facet: str) -> "BinaryFacet":
94 return BinarySelfie(self.actual, self.disk, facet)
95
96

◆ facets()

"StringFacet" selfie_lib.SelfieImplementations.DiskSelfie.facets (   self,
*str  facets 
)
Extract multiple facets from a snapshot in order to do an inline snapshot.

Reimplemented from selfie_lib.SelfieImplementations.FluentFacet.

Definition at line 90 of file SelfieImplementations.py.

90 def facets(self, *facets: str) -> "StringFacet":
91 return StringSelfie(self.actual, self.disk, list(facets))
92

◆ to_match_disk()

"DiskSelfie" selfie_lib.SelfieImplementations.DiskSelfie.to_match_disk (   self,
str   sub = "" 
)

Reimplemented in selfie_lib.SelfieImplementations.StringSelfie, and selfie_lib.SelfieImplementations.BinarySelfie.

Definition at line 68 of file SelfieImplementations.py.

68 def to_match_disk(self, sub: str = "") -> "DiskSelfie":
69 call = recordCall(False)
70 if _selfieSystem().mode.can_write(False, call, _selfieSystem()):
71 self.disk.write_disk(self.actual, sub, call)
72 else:
73 _assert_equal(self.disk.read_disk(sub, call), self.actual, _selfieSystem())
74 return self
75

◆ to_match_disk_TODO()

"DiskSelfie" selfie_lib.SelfieImplementations.DiskSelfie.to_match_disk_TODO (   self,
str   sub = "" 
)

Reimplemented in selfie_lib.SelfieImplementations.StringSelfie, and selfie_lib.SelfieImplementations.BinarySelfie.

Definition at line 76 of file SelfieImplementations.py.

76 def to_match_disk_TODO(self, sub: str = "") -> "DiskSelfie":
77 call = recordCall(False)
78 if _selfieSystem().mode.can_write(True, call, _selfieSystem()):
79 self.disk.write_disk(self.actual, sub, call)
80 _selfieSystem().write_inline(TodoStub.to_match_disk.create_literal(), call)
81 return self
82 else:
83 raise _selfieSystem().fs.assert_failed(
84 message=f"Can't call `toMatchDisk_TODO` in {Mode.readonly} mode!"
85 )
86

Member Data Documentation

◆ actual

selfie_lib.SelfieImplementations.DiskSelfie.actual

Definition at line 65 of file SelfieImplementations.py.

◆ disk

selfie_lib.SelfieImplementations.DiskSelfie.disk

Definition at line 66 of file SelfieImplementations.py.


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