We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 579e5e7 commit ef36dceCopy full SHA for ef36dce
1 file changed
tests/test_registry.py
@@ -0,0 +1,22 @@
1
+import dramatiq
2
+from dramatiq.registry import Registry
3
+
4
5
+def test_registry_can_be_declared():
6
7
+ reg = Registry()
8
9
10
+def test_actor_can_be_declared_on_registry():
11
+ # When I have a Registry
12
13
14
+ # Given that I've decorated a function with @registry.actor
15
+ @reg.actor
16
+ def add(x, y):
17
+ return x + y
18
19
+ # I expect that function to become an instance of Actor
20
+ assert isinstance(add, dramatiq.Actor)
21
+ assert add.broker is reg
22
+ assert len(reg.actors) == 1
0 commit comments