import mock

from django.test import TestCase
from mock import patch

from app.models import Match
from app.services.statistics_service import HeroesStatistics
from app.util.dota_util import HEROES_LIST

class HeroesStatisticsServiceTest(TestCase):
    fixtures = ['matches.json']

    def test_extract_heroes_statistics_for_two_matches(self):
        matches = Match.objects.all()
        hero_statistics = HeroesStatistics()
        twice_picked = list(filter(lambda s: s['played'] == 2, hero_statistics.statistics))
        picked = list(filter(lambda s: s['pick_rate'] == 100, hero_statistics.statistics))
        won_all = list(filter(lambda s: s['win_rate'] == 100, hero_statistics.statistics))
        won_half = list(filter(lambda s: s['win_rate'] == 50, hero_statistics.statistics))
        self.assertEqual(len(twice_picked), 10)
        self.assertEqual(len(picked), 10)
        self.assertEqual(len(won_all), 0)
        self.assertEqual(len(won_half), 10)

@@ -67,902 +67,75 @@
 ch%0A%0A
-from app.models import Match%0Afrom app.services.statistics_service import HeroesStatistics%0Afrom app.util.dota_util import HEROES_LIST%0A%0Aclass HeroesStatisticsServiceTest(TestCase):%0A    fixtures = %5B'matches.json'%5D%0A%0A    def test_extract_heroes_statistics_for_two_matches(self):%0A        matches = Match.objects.all()%0A        hero_statistics = HeroesStatistics()%0A        twice_picked = list(filter(lambda s: s%5B'played'%5D == 2, hero_statistics.statistics))%0A        picked = list(filter(lambda s: s%5B'pick_rate'%5D == 100, hero_statistics.statistics))%0A        won_all = list(filter(lambda s: s%5B'win_rate'%5D == 100, hero_statistics.statistics))%0A        won_half = list(filter(lambda s: s%5B'win_rate'%5D == 50, hero_statistics.statistics))%0A        self.assertEqual(len(twice_picked), 10)%0A        self.assertEqual(len(picked), 10)%0A        self.assertEqual(len(won_all), 0)%0A        self.assertEqual(len(won_half), 10)
+class StatisticsServiceTest(TestCase):%0A    fixtures = %5B'matches.json'%5D
 %0A

remove unused tests