# Path: mcm/tools.py
# class StopWatch:
# class ChainMap(UserDict):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
# def vcmp(v1, v2, op):
#     def __init__(self, *maps):
#     def __getitem__(self, key):


from mock import patch
from sys import version_info
    from time import monotonic
    from time import time
from mcm.tools import StopWatch, timer, vcmp, ChainMap
import operator
import pytest
        ('4.11','4.11',operator.ge,True),
        ('4.14','4.11',operator.ge,True),
        ('4.11','5.12',operator.ge,False),
        ('4.11','5.12',operator.lt,True),
        ('6.11','5.12',operator.lt,False),
        ('4.11','4.11',operator.le,True),
        ('4.1','4.11',operator.le,True),
        ('6.11','5.12',operator.le,False),
        ('4.11','4.11',operator.eq,True),
        ('4.10','4.1',operator.eq,False),
        ('4.10','4.1',operator.ne,True),
        ('4.11','4.11',operator.ne,False),
        ))
def test_version_comparison(v1,v2,oper,result):
    assert vcmp(v1=v1,v2=v2,op=oper) == result


@patch('mcm.tools.timer', side_effect=[14705.275287508, 14711.190629636])
class Test_StopWatch:

    def test_sets_start_value_on_entering(self, timermock):
        with StopWatch() as st:
            assert st.start == 14705.275287508

    def test_sets_stop_value_on_exiting(self, timermock):
        with StopWatch() as st:
            pass
        assert st.stop == 14711.190629636

    def test_calculates_runtime_value_rounded_to_2_digits(self, timermock):

# Path: mcm/tools.py
# class StopWatch:
# class ChainMap(UserDict):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
# def vcmp(v1, v2, op):
#     def __init__(self, *maps):
#     def __getitem__(self, key):


# Path: tests/test_tools.py
from mock import patch
from sys import version_info
    from time import monotonic
    from time import time
from mcm.tools import StopWatch, timer, vcmp, ChainMap
import operator
import pytest

        ('4.11','4.11',operator.ge,True),
        ('4.14','4.11',operator.ge,True),
        ('4.11','5.12',operator.ge,False),
        ('4.11','5.12',operator.lt,True),
        ('6.11','5.12',operator.lt,False),
        ('4.11','4.11',operator.le,True),
        ('4.1','4.11',operator.le,True),
        ('6.11','5.12',operator.le,False),
        ('4.11','4.11',operator.eq,True),
        ('4.10','4.1',operator.eq,False),
        ('4.10','4.1',operator.ne,True),
        ('4.11','4.11',operator.ne,False),
        ))
def test_version_comparison(v1,v2,oper,result):
    assert vcmp(v1=v1,v2=v2,op=oper) == result


@patch('mcm.tools.timer', side_effect=[14705.275287508, 14711.190629636])
class Test_StopWatch:

    def test_sets_start_value_on_entering(self, timermock):
        with StopWatch() as st:
            assert st.start == 14705.275287508

    def test_sets_stop_value_on_exiting(self, timermock):
        with StopWatch() as st:
            pass
        assert st.stop == 14711.190629636

    def test_calculates_runtime_value_rounded_to_2_digits(self, timermock):

        with StopWatch() as st: