-
Notifications
You must be signed in to change notification settings - Fork 11
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 #316 from nodestream-proj/scope_logger
Adding the scope to all log messages.
- Loading branch information
Showing
7 changed files
with
30 additions
and
16 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
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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
from hamcrest import assert_that, equal_to | ||
|
||
from nodestream.pipeline.meta import UNKNOWN_PIPELINE_NAME, get_context, start_context | ||
from nodestream.pipeline.meta import ( | ||
UNKNOWN_PIPELINE_NAME, | ||
UNKNOWN_PIPELINE_SCOPE, | ||
get_context, | ||
start_context, | ||
) | ||
|
||
|
||
def test_get_pipeline_name_unset(): | ||
assert_that(get_context().name, equal_to(UNKNOWN_PIPELINE_NAME)) | ||
assert_that(get_context().scope, equal_to(UNKNOWN_PIPELINE_SCOPE)) | ||
|
||
|
||
def test_get_pipeline_name_set(): | ||
with start_context("test"): | ||
def test_get_pipeline_name_and_scope_set(): | ||
with start_context("test", "test_scope"): | ||
assert_that(get_context().name, equal_to("test")) | ||
assert_that(get_context().scope, equal_to("test_scope")) | ||
assert_that(get_context().name, equal_to(UNKNOWN_PIPELINE_NAME)) | ||
assert_that(get_context().scope, equal_to(UNKNOWN_PIPELINE_SCOPE)) |