Skip to content

Commit

Permalink
Begin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
funkybob committed Jul 13, 2020
1 parent 579e5e7 commit ef36dce
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import dramatiq
from dramatiq.registry import Registry


def test_registry_can_be_declared():

reg = Registry()


def test_actor_can_be_declared_on_registry():
# When I have a Registry
reg = Registry()

# Given that I've decorated a function with @registry.actor
@reg.actor
def add(x, y):
return x + y

# I expect that function to become an instance of Actor
assert isinstance(add, dramatiq.Actor)
assert add.broker is reg
assert len(reg.actors) == 1

0 comments on commit ef36dce

Please sign in to comment.