This document has been moved to https://selenium-python.readthedocs.org
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 sys | |
sys.path.append(r"C:\webp") | |
from hello import app as application |
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
from .application import db | |
from werkzeug import generate_password_hash, check_password_hash | |
class Distribution(db.Model): | |
__tablename__ = 'distribution' | |
id = db.Column(db.Integer, primary_key=True) | |
name = db.Column(db.String(50), unique=True) | |
url = db.Column(db.String(50)) |
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
from py3k.application import db | |
from py3k.model import Distribution | |
import xmlrpclib | |
client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') | |
# XXX: Remove these hard-coding later | |
package_names = ['zope.interface', 'Twisted'] | |
#package_names = client.list_packages() | |
for name in package_names: |
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
>>> e = "Hello" | |
>>> try: | |
x = int("foo") | |
except ValueError as e: | |
print("Horror!") | |
print(e) | |
Horror! | |
invalid literal for int() with base 10: 'foo' |
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
set ts=4 | |
set sw=4 | |
set expandtab | |
syntax on | |
set history=50 | |
set autoindent smartindent | |
set smarttab | |
set backspace=eol,start,indent |
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 unittest | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
class PythonOrgSearch(unittest.TestCase): | |
def setUp(self): | |
self.browser = webdriver.Firefox() |
- 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
What are the possible reasons for not using Python 2.7 yet ?
- Google App Engine does not support Python 2.7
- The GNU/Linux stable distributions doesn't support Python 2.7 eg:- Ubuntu 10.04 LTS, Debian 6.0, RHEL 6, CentOS 6, Slackware 13.37
- Using Python 3.x and no plan to support older Python versions
- IPython is not yet supported
- Some hosting sites like iPage doesn't support Python 2.7
- To keep Jython compatibility (Jython doesn't have Python 2.7 support)
- OSX 10.6 doesn't support Python 2.7
OlderNewer