-
-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): | ||
|
||
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 |