@@ -123,7 +123,7 @@ async def state_changed(event):
123
123
assert "modules/xyz2/other global_ctx=modules.xyz2.other;" in caplog .text
124
124
assert "hello global_ctx=file.hello xyz=123 xyz2.xyz=123" in caplog .text
125
125
assert "world2.other global_ctx=apps.world2.other" in caplog .text
126
- assert "world2.__init__ global_ctx=apps.world2.__init__ var1=100, other_abc=987" in caplog .text
126
+ assert "world2 global_ctx=apps.world2.__init__ var1=100, other_abc=987" in caplog .text
127
127
128
128
#
129
129
# add a new script file
@@ -192,7 +192,7 @@ def func20():
192
192
#
193
193
conf ["apps" ]["world2" ]["var1" ] = 200
194
194
await hass .services .async_call ("pyscript" , "reload" , {}, blocking = True )
195
- assert "world2.__init__ global_ctx=apps.world2.__init__ var1=200, other_abc=987" in caplog .text
195
+ assert "world2 global_ctx=apps.world2.__init__ var1=200, other_abc=987" in caplog .text
196
196
197
197
#
198
198
# change a module inside an app
@@ -208,15 +208,15 @@ def func20():
208
208
f"{ conf_dir } /apps/world2/other.py"
209
209
]
210
210
await hass .services .async_call ("pyscript" , "reload" , {}, blocking = True )
211
- assert "world2.__init__ global_ctx=apps.world2.__init__ var1=200, other_abc=654" in caplog .text
211
+ assert "world2 global_ctx=apps.world2.__init__ var1=200, other_abc=654" in caplog .text
212
212
213
213
#
214
214
# now confirm certain files reloaded the correct number of times,
215
215
# and reload everything a few times
216
216
#
217
217
for i in range (3 ):
218
218
assert caplog .text .count ("world global_ctx=apps.world xyz=" ) == 2 + i
219
- assert caplog .text .count ("world2.__init__ global_ctx=apps.world2.__init__ var1=" ) == 3 + i
219
+ assert caplog .text .count ("world2 global_ctx=apps.world2.__init__ var1=" ) == 3 + i
220
220
assert caplog .text .count ("hello global_ctx=file.hello xyz=" ) == 4 + i
221
221
assert caplog .text .count ("modules/xyz2/other global_ctx=modules.xyz2.other" ) == 2 + i
222
222
assert caplog .text .count ("modules/xyz2 global_ctx=modules.xyz2.__init__" ) == 2 + i
0 commit comments