File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 7373 out : |
7474 main:10: error: Argument 1 to "then_return" of "Stub" has incompatible type "str"; expected "int" [arg-type]
7575
76+ - case : mock_class_attribute_get
77+ main : |
78+ from decoy import Decoy
79+
80+ class Dependency():
81+ @property
82+ def value(self) -> int:
83+ return 42
84+
85+ decoy = Decoy()
86+ fake = decoy.mock(cls=Dependency)
87+
88+ decoy.when(fake.value).then_return(42)
89+ decoy.when(fake.value).then_return("wrong-type")
90+ out : |
91+ main:12: error: Argument 1 to "then_return" of "Stub" has incompatible type "str"; expected "int" [arg-type]
92+
93+ - case : mock_class_attribute_set
94+ main : |
95+ from decoy import Decoy
96+
97+ class Dependency():
98+ @property
99+ def value(self) -> int:
100+ return 42
101+
102+ decoy = Decoy()
103+ fake = decoy.mock(cls=Dependency)
104+ prop = decoy.prop(fake.value)
105+
106+ decoy.when(prop.set(42)).then_raise(Exception("oh no"))
107+ decoy.when(prop.set("goodbye")).then_raise(Exception("oh no"))
108+ out : |
109+ main:13: error: Argument 1 to "set" of "Prop" has incompatible type "str"; expected "int" [arg-type]
110+
76111 - case : context_manager_stub_mimics_enter_type
77112 main : |
78113 import contextlib
You can’t perform that action at this time.
0 commit comments