# Path: mwscan/ruleset.py
# def strip_last_url_path(url):
# def last_url_path(url):
#     def __init__(self, **kwargs):
#     def find_whitelist_in_rawrules(self, rawrules):
#     def get_rules(self):
#     def get_whitelist(self):
#     def transform_rules(self, rawrules):
#     def _get_cache_filename(self, url):
#     def _get_cache_timestamp_content(self, cachefile):
#     def _httpget(self, url):
#     def get(self):
#     def _recursive_fetch(self, url):
#         def include(match):
#     def get_rules(self):
#     def transform_rules(self, rawrules):
# class RulesProvider:
# class Files(RulesProvider):
# class NBS(RulesProvider):
# class Magemojo(RulesProvider):
# class Magesec(RulesProvider):
# class Mwscan(RulesProvider):
# class MageHost(RulesProvider):
# 
# Path: mwscan/settings.py
# CACHEDIR = os.path.expanduser('~/.cache/mwscan')
# LAST_RUN_FILE = os.path.join(CACHEDIR, 'last_run')
# DEFAULT_EXCLUDEFILE = os.path.expanduser('~/.config/mwscan/excludes')
# CODE_EXT = ('php', 'phtml', 'js', 'jsx', 'html', 'php3', 'php4', 'php5', 'php7', 'sh', 'ini')


import os
import sys
import mwscan.ruleset
    import mock
    import requests_cache
from mwscan.ruleset import providers, RulesProvider
from mwscan import settings
from unittest import TestCase
    from unittest import mock
        # no other way to count unfortunately
        got_numrules = len(list(iter(rules)))
        got_numwhitelist = len(whitelist)

        assert type(rules).__name__ == 'Rules', \
            'wrong type: %s' % type(rules).__name__

        assert got_numrules >= expected_numrules, \
          'wrong num rules: %s' % got_numrules

        assert got_numwhitelist >= expected_numwhitelist, \
            'wrong num whitelists %s' % got_numwhitelist

    def test_providers(self):

        tests = (
            # provider, min rules, min whitelisted
            ('nbs', 15, 1279),
            ('byte', 60, 20),
            ('magesec', 150, 100000),
            # ('magemojo', 150, 65000),
        )

        for provider, numrules, numwhitelists in tests:
            yield self._check_provider, provider, numrules, numwhitelists


class TestHttpGet(TestCase):

    def setUp(self):

# Path: mwscan/ruleset.py
# def strip_last_url_path(url):
# def last_url_path(url):
#     def __init__(self, **kwargs):
#     def find_whitelist_in_rawrules(self, rawrules):
#     def get_rules(self):
#     def get_whitelist(self):
#     def transform_rules(self, rawrules):
#     def _get_cache_filename(self, url):
#     def _get_cache_timestamp_content(self, cachefile):
#     def _httpget(self, url):
#     def get(self):
#     def _recursive_fetch(self, url):
#         def include(match):
#     def get_rules(self):
#     def transform_rules(self, rawrules):
# class RulesProvider:
# class Files(RulesProvider):
# class NBS(RulesProvider):
# class Magemojo(RulesProvider):
# class Magesec(RulesProvider):
# class Mwscan(RulesProvider):
# class MageHost(RulesProvider):
# 
# Path: mwscan/settings.py
# CACHEDIR = os.path.expanduser('~/.cache/mwscan')
# LAST_RUN_FILE = os.path.join(CACHEDIR, 'last_run')
# DEFAULT_EXCLUDEFILE = os.path.expanduser('~/.config/mwscan/excludes')
# CODE_EXT = ('php', 'phtml', 'js', 'jsx', 'html', 'php3', 'php4', 'php5', 'php7', 'sh', 'ini')


# Path: mwscan/tests/test_ruleset.py
import os
import sys
import mwscan.ruleset
    import mock
    import requests_cache
from mwscan.ruleset import providers, RulesProvider
from mwscan import settings
from unittest import TestCase
    from unittest import mock

        # no other way to count unfortunately
        got_numrules = len(list(iter(rules)))
        got_numwhitelist = len(whitelist)

        assert type(rules).__name__ == 'Rules', \
            'wrong type: %s' % type(rules).__name__

        assert got_numrules >= expected_numrules, \
          'wrong num rules: %s' % got_numrules

        assert got_numwhitelist >= expected_numwhitelist, \
            'wrong num whitelists %s' % got_numwhitelist

    def test_providers(self):

        tests = (
            # provider, min rules, min whitelisted
            ('nbs', 15, 1279),
            ('byte', 60, 20),
            ('magesec', 150, 100000),
            # ('magemojo', 150, 65000),
        )

        for provider, numrules, numwhitelists in tests:
            yield self._check_provider, provider, numrules, numwhitelists


class TestHttpGet(TestCase):

    def setUp(self):

        self.rp = RulesProvider()