This document has been moved to https://selenium-python.readthedocs.org/en/latest/
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 pytest | |
from random import randint | |
import logging | |
import pickle | |
logging.basicConfig(filename="log.log", level=logging.INFO) | |
class App(object): | |
def __init__(self): | |
self.a = randint(0, 100) |
- http://stackoverflow.com/questions/463278/what-is-a-stub
- http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy#MockTestingTools
- http://pypi.python.org/pypi/MiniMock
- http://www.voidspace.org.uk/python/mock/compare.html
- http://garybernhardt.github.com/python-mock-comparison/
- http://c2.com/cgi/wiki?MockStubShunt
- http://c2.com/cgi/wiki?MockObject
- http://pypi.python.org/pypi/mock
- http://c2.com/cgi/wiki?LawOfDemeter
- http://martinfowler.com/articles/mocksArentStubs.html
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
amazon_sender.py | |
~~~~~~~~ | |
Python helper class that can send emails using Amazon SES and boto. | |
The biggest feature of this class is that encodings are handled properly. | |
It can send both text and html emails. | |
This implementation is using Python's standard library (which opens up for a lot more options). |
This file contains 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 socket | |
HOST, PORT = "localhost", 9999 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
try: | |
sock.connect((HOST, PORT)) | |
sock.send("get" + "\n") |
This file contains 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 time | |
import pytest | |
def pytest_configure_node(node): | |
node.slaveinput['all_nodes'] = {'a': True, 'b': True, 'c': True} | |
node.slaveinput['used_nodes'] = {} | |
def _get_browser(request): | |
def get_browser(): | |
class Browser(object): |
This file contains 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 win32clipboard, win32con | |
def get_pattern(): | |
text = str(eval(raw_input("Pattern:\n"))) | |
win32clipboard.OpenClipboard() | |
win32clipboard.EmptyClipboard() | |
win32clipboard.SetClipboardText(text) | |
win32clipboard.CloseClipboard() |
This file contains 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
;;; python-pep8.el --- minor mode for running `pep8' | |
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com> | |
;; Author: Ian Eure <ian.eure@gmail.com> | |
;; Keywords: languages python | |
;; Last edit: 2010-02-12 | |
;; Version: 1.01 |