Skip to content

Commit

Permalink
Added the first test for the stat instance (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
jb098 authored and aecay committed Nov 1, 2019
1 parent 5ad8769 commit 7764d86
Showing 1 changed file with 24 additions and 0 deletions.
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

0 comments on commit 7764d86

Please sign in to comment.