# Path: xpaw/stats.py
# class StatsCollector:
#     def __init__(self):
#         self._stats = {}
# 
#     def get(self, key, default=None):
#         return self._stats.get(key, default)
# 
#     def set(self, key, value):
#         self._stats[key] = value
# 
#     def set_default(self, key, default=None):
#         self._stats.setdefault(key, default)
# 
#     def set_min(self, key, value):
#         self._stats[key] = min(self._stats.setdefault(key, value), value)
# 
#     def set_max(self, key, value):
#         self._stats[key] = max(self._stats.setdefault(key, value), value)
# 
#     def inc(self, key, value=1, start=0):
#         self._stats[key] = self._stats.setdefault(key, start) + value
# 
#     def clear(self):
#         self._stats.clear()
# 
#     def remove(self, key):
#         if key in self._stats:
#             del self._stats[key]
# 
#     @property
#     def stats(self):
#         return self._stats
# 
#     def set_stats(self, stats):
#         self._stats = stats
# 
# class DummyStatsCollector(StatsCollector):
#     def get(self, key, default=None):
#         return default
# 
#     def set(self, key, value):
#         pass
# 
#     def set_default(self, key, default=None):
#         pass
# 
#     def set_min(self, key, value):
#         pass
# 
#     def set_max(self, key, value):
#         pass
# 
#     def inc(self, key, value=1, start=0):
#         pass
# 
#     def set_stats(self, stats):
#         pass


from xpaw.stats import StatsCollector, DummyStatsCollector

    def test_set_stats(self):
        stats = StatsCollector()
        stats.set_stats({'key1': 1, 'key2': 2})
        assert stats.stats == {'key1': 1, 'key2': 2}

    def test_remove_key(self):
        stats = StatsCollector()
        stats.set('key', 'value')
        assert stats.get('key') == 'value'
        stats.remove('key')
        assert stats.get('key') is None
        assert stats.get('key', 'default') == 'default'


class TestDummyStatsCollector:
    def test_set_value(self):
        stats = DummyStatsCollector()
        assert stats.get('key') is None
        stats.set('key', 'value')
        assert stats.get('key') is None
        assert stats.get('key', 'default') == 'default'
        stats.set_min('key', 0)
        assert stats.get('key') is None
        stats.set_max('key', 0)
        assert stats.get('key') is None
        stats.set_default('key', 'value')
        assert stats.get('key') is None

    def test_inc_value(self):

# Path: xpaw/stats.py
# class StatsCollector:
#     def __init__(self):
#         self._stats = {}
# 
#     def get(self, key, default=None):
#         return self._stats.get(key, default)
# 
#     def set(self, key, value):
#         self._stats[key] = value
# 
#     def set_default(self, key, default=None):
#         self._stats.setdefault(key, default)
# 
#     def set_min(self, key, value):
#         self._stats[key] = min(self._stats.setdefault(key, value), value)
# 
#     def set_max(self, key, value):
#         self._stats[key] = max(self._stats.setdefault(key, value), value)
# 
#     def inc(self, key, value=1, start=0):
#         self._stats[key] = self._stats.setdefault(key, start) + value
# 
#     def clear(self):
#         self._stats.clear()
# 
#     def remove(self, key):
#         if key in self._stats:
#             del self._stats[key]
# 
#     @property
#     def stats(self):
#         return self._stats
# 
#     def set_stats(self, stats):
#         self._stats = stats
# 
# class DummyStatsCollector(StatsCollector):
#     def get(self, key, default=None):
#         return default
# 
#     def set(self, key, value):
#         pass
# 
#     def set_default(self, key, default=None):
#         pass
# 
#     def set_min(self, key, value):
#         pass
# 
#     def set_max(self, key, value):
#         pass
# 
#     def inc(self, key, value=1, start=0):
#         pass
# 
#     def set_stats(self, stats):
#         pass


# Path: tests/test_stats.py
from xpaw.stats import StatsCollector, DummyStatsCollector


    def test_set_stats(self):
        stats = StatsCollector()
        stats.set_stats({'key1': 1, 'key2': 2})
        assert stats.stats == {'key1': 1, 'key2': 2}

    def test_remove_key(self):
        stats = StatsCollector()
        stats.set('key', 'value')
        assert stats.get('key') == 'value'
        stats.remove('key')
        assert stats.get('key') is None
        assert stats.get('key', 'default') == 'default'


class TestDummyStatsCollector:
    def test_set_value(self):
        stats = DummyStatsCollector()
        assert stats.get('key') is None
        stats.set('key', 'value')
        assert stats.get('key') is None
        assert stats.get('key', 'default') == 'default'
        stats.set_min('key', 0)
        assert stats.get('key') is None
        stats.set_max('key', 0)
        assert stats.get('key') is None
        stats.set_default('key', 'value')
        assert stats.get('key') is None

    def test_inc_value(self):

        stats = DummyStatsCollector()