1from typing
import Any, Callable, TypeVar, overload
4from .SelfieImplementations
import BinarySelfie, DiskSelfie, ReprSelfie, StringSelfie
35def expect_selfie(actual: Any, camera: Any =
None) -> DiskSelfie:
36 disk_storage = _selfieSystem().disk_thread_local()
37 if camera
is not None:
38 if isinstance(camera, Camera):
39 actual_snapshot = camera.snapshot(actual)
41 actual_snapshot = camera(actual)
43 elif isinstance(actual, str):
45 elif isinstance(actual, Snapshot):
47 elif isinstance(actual, bytes):
48 return BinarySelfie(Snapshot.of(actual), disk_storage,
"")
50 return ReprSelfie(actual, Snapshot.of(repr(actual)), disk_storage)