-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from mottosso/master
Emitting "published", "validated", "extracted" and "integrated" events.
- Loading branch information
Showing
6 changed files
with
79 additions
and
12 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
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
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,38 @@ | ||
import pyblish.api | ||
import pyblish.util | ||
from nose.tools import ( | ||
with_setup, | ||
) | ||
from . import lib | ||
|
||
|
||
@with_setup(lib.setup_empty) | ||
def test_published_event(): | ||
"""published is emitted upon finished publish""" | ||
|
||
count = {"#": 0} | ||
|
||
def on_published(context): | ||
assert isinstance(context, pyblish.api.Context) | ||
count["#"] += 1 | ||
|
||
pyblish.api.register_callback("published", on_published) | ||
pyblish.util.publish() | ||
|
||
assert count["#"] == 1, count | ||
|
||
|
||
@with_setup(lib.setup_empty) | ||
def test_validated_event(): | ||
"""validated is emitted upon finished validation""" | ||
|
||
count = {"#": 0} | ||
|
||
def on_validated(context): | ||
assert isinstance(context, pyblish.api.Context) | ||
count["#"] += 1 | ||
|
||
pyblish.api.register_callback("validated", on_validated) | ||
pyblish.util.validate() | ||
|
||
assert count["#"] == 1, count |
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