This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ConfigParser | |
from selenium import webdriver | |
class WebdriverFactory(object): | |
def setup_selenium_from_config(self, config): | |
"""Start selenium with values from config file, or defaults | |
rather than requiring the command-line options. File must be | |
ConfigParser compliant and have a section called 'SELENIUM'. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import unittest | |
from testresources import OptimisingTestSuite | |
from subunit.run import SubunitTestProgram, SubunitTestRunner, get_default_formatter | |
import io, sys, os, logging | |
import fixtures | |
from testtools import content | |
from testtools.testcase import gather_details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This plugin replaces the built-in FinalizingSuiteWrapper with | |
testresources.OptimisingTestSuite. | |
""" | |
from nose.plugins.base import Plugin | |
from nose.suite import FinalizingSuiteWrapper | |
from nose.case import Test | |
from nose.plugins.manager import DefaultPluginManager | |
from testresources import OptimisingTestSuite | |
import unittest2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/ss/bin/python | |
import swiftclient | |
import logging | |
import signal | |
import time | |
from optparse import OptionParser | |
import json | |
METHODS = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScreenshotTaker(): | |
def __init__(self, webdriver, logger=None): | |
self.wd = webdriver | |
self.logger = logger | |
def __enter__(self): | |
pass | |
def __exit__(self, exec_type, value, tb): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
or set up apache to proxy (instructions for ubuntu) | |
insert into /etc/apache2/apache2.conf | |
ProxyPass / http://localhost:8000/ | |
ProxyPassReverse / http://localhost:8000/ | |
cd etc/apache2 | |
sudo ln -s ../mods-available/proxy_http.load /etc/apache2/mods-enabled | |
sudo ln -s ../mods-available/proxy.load /etc/apache2/mods-enabled | |
sudo service apache2 restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tests.case.api import ApiTestCase | |
class ApiCrudCases(ApiTestCase): | |
"""Re-usable test cases for Create, Read, Update, and Delete""" | |
def test_create(self): | |
pass | |
def test_create_fails_with_wrong_perms(self): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put local variants on settings.py here to be used by foreman | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'soundfit', | |
'USER': 'postgres', | |
'PASSWORD': 'obscured', | |
'HOST': '', | |
'PORT': '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pytest_terminal_summary(terminalreporter): | |
config = terminalreporter.config | |
if not test_cases or config.option.verbose < 1: | |
return | |
tw = terminalreporter._tw | |
tw.sep('-', 'this line will not show up with -n 1') | |
tw.line('this line should show up') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
no_proxy_json = r'{"avoid-proxy":true}' | |
if options.run_everywhere: | |
browsers = [ | |
('--platform=LINUX --browsername=firefox --browserver=13 --capabilities=' + no_proxy_json + ' ', 'linux_firefox_13'), | |
('--platform=LINUX --browsername=opera --browserver=12 ', 'linux_opera_12'), | |
('--platform=MAC --browsername=firefox --browserver=14 --capabilities=' + no_proxy_json + ' ', 'mac_firefox_14'), | |
('--platform=VISTA --browsername=chrome --capabilities=' + no_proxy_json + ' ', 'vista_chrome'), | |
('--platform=VISTA --browsername=firefox --browserver=13 --capabilities=' + no_proxy_json + ' ', 'vista_firefox_13'), | |
('--platform=VISTA --browsername="internet explorer" --browserver=9 ', 'vista_ie_9'), |