<commit_before># -*- coding: utf-8 -*-

from __future__ import unicode_literals

from dash.api import API
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import timezone
from smartmin.tests import SmartminTest
from django.contrib.auth.models import User
from dash.orgs.middleware import SetOrgMiddleware
from mock import Mock, patch
from dash.orgs.models import Org
from django.http.request import HttpRequest
from ureport.jobs.models import JobSource
from ureport.public.views import IndexView
from temba_client.client import TembaClient, Result, Flow, Group, Boundary as TembaBoundary, Field as TembaContactField
from temba_client.client import Contact as TembaContact, Group as TembaGroup
from temba_client.types import Geometry as TembaGeometry


class MockAPI(API):  # pragma: no cover

    def get_group(self, name):
        return dict(group=8, name=name, size=120)

    def get_country_geojson(self):
        return dict(
                   type="FeatureCollection",
                   features=[
                       dict(
                           type='Feature',
                           properties=dict(
                               id="R3713501",
                               level=1,
                               name="Abia"
                           ),
                           geometry=dict(
                               type="MultiPolygon",
                               coordinates=[
                                   [
                                       [
                                           [7, 5]
                                       ]
                                   ]
                               ]
                           )
                       )
                   ]
            )

    def get_state_geojson(self, state_id):
        return dict(type="FeatureCollection",
                    features=[dict(type='Feature',
                                   properties=dict(id="R3713502",
                                                   level=2,
                                                   name="Aba North"),
                                   geometry=dict(type="MultiPolygon",
                                                 coordinates=[[[[8, 4]]]]
                                                 )
                                   )
                            ]
                    )

    def get_ruleset_results(self, ruleset_id, segment=None):
        return [dict(open_ended=False,
                     set=3462,
                     unset=3694,
                     categories=[dict(count=2210,
                                      label='Yes'
                                      ),
                                 dict(count=1252,
                                      label='No'
                                      )
                                 ],<commit_msg>updated test script to reflect changes to method names<commit_after># -*- coding: utf-8 -*-

from __future__ import unicode_literals

from dash.api import API
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils import timezone
from smartmin.tests import SmartminTest
from django.contrib.auth.models import User
from dash.orgs.middleware import SetOrgMiddleware
from mock import Mock, patch
from dash.orgs.models import Org
from django.http.request import HttpRequest
from ureport.jobs.models import JobSource
from ureport.public.views import IndexView
from temba_client.client import TembaClient, Result, Flow, Group, Boundary as TembaBoundary, Field as TembaContactField
from temba_client.client import Contact as TembaContact, Group as TembaGroup
from temba_client.types import Geometry as TembaGeometry


class MockAPI(API):  # pragma: no cover

    def get_group(self, name):
        return dict(group=8, name=name, size=120)

    def get_country_geojson(self):
        return dict(
                   type="FeatureCollection",
                   features=[
                       dict(
                           type='Feature',
                           properties=dict(
                               id="R3713501",
                               level=1,
                               name="Abia"
                           ),
                           geometry=dict(
                               type="MultiPolygon",
                               coordinates=[
                                   [
                                       [
                                           [7, 5]
                                       ]
                                   ]
                               ]
                           )
                       )
                   ]
            )

    def get_geojson_by_parent_id(self, parent_id):
        return dict(type="FeatureCollection",
                    features=[dict(type='Feature',
                                   properties=dict(id="R3713502",
                                                   level=2,
                                                   name="Aba North"),
                                   geometry=dict(type="MultiPolygon",
                                                 coordinates=[[[[8, 4]]]]
                                                 )
                                   )
                            ]
                    )

    def get_ruleset_results(self, ruleset_id, segment=None):
        return [dict(open_ended=False,
                     set=3462,
                     unset=3694,
                     categories=[dict(count=2210,
                                      label='Yes'
                                      ),
                                 dict(count=1252,
                                      label='No'
                                      )
                                 ],
{'fraction_non_alphanumeric': 0.06376811594202898, 'fraction_numerical': 0.013981244671781756, 'mean_word_length': 0.9213887979037013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 45, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '301599', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1184, 'n_words': 284}