-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the first test for the stat instance (#91)
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from mite.stats import labels_extractor | ||
|
||
|
||
TXN_MSG = { | ||
'start_time': 1572604344.7903123, | ||
'end_time': 1572604346.0693598, | ||
'had_error': True, | ||
'type': 'txn', | ||
'time': 1572604346.0693617, | ||
'test': 'mite_project.file:scenario', | ||
'runner_id': 1, | ||
'journey': 'mite_project.file:journey', | ||
'context_id': 8, | ||
'scenario_id': 31, | ||
'scenario_data_id': 2, | ||
'transaction': 'txn_name', | ||
'transaction_id': 3} | ||
|
||
|
||
def test_labels_extractor_txn_msg(): | ||
extractor = labels_extractor("test journey transaction had_error".split()) | ||
labels = extractor(TXN_MSG) | ||
expected_value = ("mite_project.file:scenario", "mite_project.file:journey", "txn_name", True) | ||
assert next(labels) == expected_value |