Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the first test for the stat instance #91

Merged
merged 2 commits into from
Nov 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/test_stats.py
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