Skip to content

Instantly share code, notes, and snippets.

View backfill.py
# 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
View backfill.py
# 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 Jul 30, 2013
add test for crontabber_state_json() view -- bug 888952
View gist:6118039
@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 Jul 30, 2013
add test for crontabber_state_json() view -- bug 888952
View gist:6118035
@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": {
View test_submitter_app.py
# 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 (
View gist:5938460
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
View gist:5902363
@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 Aug 4, 2018
A simple test using behave and selenium
View environment.py
from selenium import webdriver
def before_all(context):
context.browser = webdriver.Firefox()
def after_all(context):
context.browser.quit()
@GabiThume
GabiThume / results
Last active Dec 18, 2015
coverage of socorro unittest
View results
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 Jun 17, 2013
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'])"
View gist:5798726
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