-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow docs_src source files in tests
- Loading branch information
Showing
16 changed files
with
62 additions
and
13 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,31 @@ | ||
from guides.change_state_008 import User, UserApplicationServices | ||
|
||
from protean import current_domain | ||
|
||
|
||
def test_import_my_module(): | ||
try: | ||
from guides.change_state_008 import ( | ||
Registered, | ||
User, | ||
UserApplicationServices, | ||
auth, | ||
) | ||
|
||
assert True # If the import succeeds, the test passes | ||
except ImportError: | ||
assert False, "Module in docs_src could not be imported" | ||
|
||
|
||
def test_application_service_method_invocation(): | ||
# Run a sample test from elements declared in docs_src | ||
app_services_obj = UserApplicationServices() | ||
|
||
user_id = app_services_obj.register_user( | ||
email="[email protected]", name="John Doe" | ||
) | ||
assert user_id is not None | ||
|
||
app_services_obj.activate_user(user_id) | ||
user = current_domain.repository_for(User).get(user_id) | ||
assert user.status == "ACTIVE" |