Skip to content

Commit 4e0c15d

Browse files
committed
[tests] WIP Plugins
1 parent 0592199 commit 4e0c15d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

meshroom/core/plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,14 @@ def reload(self):
212212

213213
updated = importlib.reload(sys.modules.get(self.nodeDescriptor.__module__))
214214
descriptor = getattr(updated, self.nodeDescriptor.__name__)
215-
self._timestamp = os.path.getmtime(self.path)
216215

217216
if not descriptor:
218217
self.status = NodePluginStatus.ERROR
219218
logging.error(f"[Reload] {self.nodeDescriptor.__name__}: The node description at {self.path} "
220219
"was not found.")
221220
return
222221

222+
self._timestamp = os.path.getmtime(self.path)
223223
self.nodeDescriptor = descriptor
224224
self.errors = validateNodeDesc(descriptor)
225225

tests/test_plugins.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ def test_reloadNodePlugin(self):
185185
# Attempt to register node plugin
186186
pluginManager.registerNode(node)
187187
assert pluginManager.isRegistered(nodeName)
188+
189+
# Reload the node again without any change
190+
node.reload()
191+
assert pluginManager.isRegistered(nodeName)
188192

189193
# Restore the node file to its original state (with a description error)
190194
with open(node.path, "w") as f:

0 commit comments

Comments
 (0)