Skip to content

Commit ef36dce

Browse files
committed
Begin tests
1 parent 579e5e7 commit ef36dce

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/test_registry.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
reg = Registry()
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

Comments
 (0)