Пример #1
0
    def test_startup(self):
        # print('Current path:%s' % os.path.abspath(os.path.curdir))
        asimo = Robots.get_one(TestReportManager)
        log = asimo.log

        assert log.get_filter_result("/adwiser/index.html") == "/content/sites/aviva_uk/django.wsgi"
        assert log.get_filter_result("/submissions") == None
        assert log.get_filter_result("/yourbusiness/") == "/content/sites/oneaviva/yourbusiness/django.wsgi"
        assert log.get_filter_result("/distinct/admin") == "/content/sites/oneaviva/distinct/django.wsgi"
Пример #2
0
    exclude_domains = [
        '',
    ]

class YourSite_log(LogBase):
    PATH = 'yoursite-access_log' # apache access log name
    URL = 'dev.yoursite.com'     # URL to test

    
class AnotherSite_log(LogBase):
    PATH = 'anothersite-access_log'
    URL = 'dev.anothersite.co.uk'

    
class Reportmanager(ReportmanagerBase):
    DATE_FMT    = "rs_%y%m%d%H%M%S.txt" # report name format
    REPORT = os.path.join(LogBase.CASE, 'reports', 
            datetime.today().strftime(DATE_FMT)) # Report path
    
    LOGS = [                # List of logs (above) to process
        YourSite_log(), 
        AnotherSite_log(),
    ]
    MAX_TASKS = 10      # Number of concurrent processes
    NEW_TASK_DELAY = 10 # Delay before starting next process
    MAX_TASK_GETS = 100 # Maximum number of gets / process


if __name__ == '__main__':
    Robots.run(ReportManager)