Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
from socorro.external.postgresql.backfill import Backfill
from nose.plugins.attrib import attr
from .unittestbase import PostgreSQLTestCase
from socorro.lib import datetimeutil
from socorro.external.postgresql import fakedata
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from socorro.external.postgresql.base import PostgreSQLBase
from socorro.lib import external_common
import socorro.database.database as db
from socorro.external import MissingOrBadArgumentError
@GabiThume
GabiThume / gist:6118039
Created July 30, 2013 23:39
add test for crontabber_state_json() view -- bug 888952
@mock.patch('requests.get')
def test_crontabber_state_json(self, rget):
url = reverse('crashstats.crontabber_state_json')
def mocked_get(**options):
assert 'crontabber_state' in options['url']
return Response("""
{
"state": {
"slow-one": {
@GabiThume
GabiThume / gist:6118035
Created July 30, 2013 23:38
add test for crontabber_state_json() view -- bug 888952
@mock.patch('requests.get')
def test_crontabber_state_json(self, rget):
url = reverse('crashstats.crontabber_state_json')
def mocked_get(**options):
assert 'crontabber_state' in options['url']
return Response("""
{
"state": {
"slow-one": {
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
import mock
import time
import json
from socorro.collector.submitter_app import (
@GabiThume
GabiThume / gist:5938460
Created July 6, 2013 03:01
Socorro Coverage
Name Stmts Miss Cover Missing
-------------------------------------------------------------------------------------------
socorro 0 0 100%
socorro.app 0 0 100%
socorro.app.fetch_transform_save_app 73 10 86% 118-124, 127-133, 136-137, 155, 159
socorro.app.generic_app 78 8 90% 129, 160-161, 204-211
socorro.collector 0 0 100%
socorro.collector.collector_app 26 1 96% 111
socorro.collector.crashmover_app 10 1 90% 22
socorro.collector.throttler 88 5 94% 102, 136-137, 162-163
@mock.patch('requests.get')
def test_exploitable_crashes(self, rget):
url = reverse('crashstats.exploitable_crashes')
def mocked_get(url, **options):
assert 'crashes/exploitability' in url
return Response("""
{
"hits": [
@GabiThume
GabiThume / environment.py
Last active August 4, 2018 15:51
A simple test using behave and selenium
from selenium import webdriver
def before_all(context):
context.browser = webdriver.Firefox()
def after_all(context):
context.browser.quit()
@GabiThume
GabiThume / results
Last active December 18, 2015 15:59
coverage of socorro unittest
Do not exist testing directory for: webapi.
Missing tests in lib:
['socorro/socorro/lib/productVersionCache.py', 'socorro/socorro/lib/dynamicConfigurationManager.py', 'socorro/socorro/lib/uuid.py', 'socorro/socorro/lib/threadlib.py', 'socorro/socorro/lib/stats.py', 'socorro/socorro/lib/httpclient.py']
All coverage in processor.
All coverage in database.
Do not exist testing directory for: othertests.
@GabiThume
GabiThume / gist:5798726
Created June 17, 2013 17:48
This error is reached when "make" is running the following command: $ sudo /home/gabi/Desktop/CODE/repos/socorro/socorro-virtualenv/bin/python -c "from pgxnclient import cli; cli.main(['install', 'json_enhancements'])"
No handlers could be found for logger "pgxnclient.commands"
Makefile:51: /usr/lib/postgresql/9.2/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory
make: *** No rule to make target `/usr/lib/postgresql/9.2/lib/pgxs/src/makefiles/pgxs.mk'. Stop.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/gabi/Desktop/CODE/repos/socorro/socorro-virtualenv/lib/python2.6/site-packages/pgxnclient/cli.py", line 31, in main
run_command(opt, parser)
File "/home/gabi/Desktop/CODE/repos/socorro/socorro-virtualenv/lib/python2.6/site-packages/pgxnclient/commands/__init__.py", line 96, in run_command
return opts.cmd(opts, parser=parser).run()
File "/home/gabi/Desktop/CODE/repos/socorro/socorro-virtualenv/lib/python2.6/site-packages/pgxnclient/commands/install.py", line 149, in run