Skip to content

Instantly share code, notes, and snippets.

@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()
View review.md

Information Packets (IP)

Primary properties

Improve markdown of this section

Optional properties

Instead of just 'scope - see scope', add some information about scope and then '(for more information, see scope)' for instance.

Ports API

View gist:6617400
model = models.TCBS
api = model()
def mocked_get(**options):
assert 'crashes/signatures' in options['url']
# expect no os_name parameter encoded in the URL
assert '/os/' not in options['url']
return Response("""
{"crashes": [],
"totalPercentage": 0,
"start_date": "2013-05-10",
View gist:6504095
INSERT INTO raw_crashes (uuid, raw_crash, date_processed) VALUES (12dd97c3-6459-a77f-f474-edb8f0130910, { "uuid": "12dd97c3-6459-a77f-f474-edb8f0130910", "IsGarbageCollecting": "1" }, 2013-09-10 19:51:18.377914)
INSERT INTO raw_crashes (uuid, raw_crash, date_processed) VALUES (c02cb7f1-f051-d5f6-db21-f340c0130910, { "uuid": "c02cb7f1-f051-d5f6-db21-f340c0130910", "IsGarbageCollecting": "1" }, 2013-09-10 19:51:18.377914)
INSERT INTO raw_crashes (uuid, raw_crash, date_processed) VALUES (60597bdc-5dbe-4409-6b38-4309c0130909, { "uuid": "60597bdc-5dbe-4409-6b38-4309c0130909", "IsGarbageCollecting": "1" }, 2013-09-09 19:52:38.070392)
E
======================================================================
ERROR: testx (socorro.unittest.external.postgresql.test_backfill.TestBackfill)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/gabi/Desktop/CODE/src/socorro/socorro/unittest/external/postgresql/test_backfill.py", line 51, in setUp
cursor.e
View statsd at middleware_app.py
socorro./aux/.200
socorro./aux/age/.200
socorro./aux/gender/.200
socorro./aux/misconfigured/.405
socorro./aux/foo/bar/names/peter+anders.200
socorro./aux/.200
socorro./aux/.405
socorro./aux/bla.500
socorro./aux/.200
socorro./backfill/backfill_type/adu/update_day/2013-08-22/.200
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: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": {
@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": {
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 (