[Checkins] SVN: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ pep8-ify
Jan-Wijbrand Kolman
janwijbrand at gmail.com
Mon Jun 14 01:59:49 EDT 2010
Log message for revision 113438:
pep8-ify
Changed:
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/base.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/tests/test_static.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/tests/test_util.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/util.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/__init__.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_selenese.py
U gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_ztk.py
-=-
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/base.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/base.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/base.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -15,6 +15,7 @@
import gocept.selenium.selenese
import selenium
+
class Layer(object):
# override in subclass:
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -1,6 +1,6 @@
#############################################################################
#
-# Copyright (c) 2009 Zope Foundation and Contributors.
+# Copyright (c) 2010 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -17,12 +17,14 @@
import subprocess
import sys
import tempfile
+import time
import unittest
import gocept.selenium.base
_suffix = 'gocept.selenium.static'
+
class StaticFilesLayer(gocept.selenium.base.Layer):
host = 'localhost'
@@ -63,8 +65,10 @@
continue
os.remove(fullpath)
+
static_files_layer = StaticFilesLayer()
+
class StaticFilesTestCase(gocept.selenium.base.TestCase, unittest.TestCase):
layer = static_files_layer
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/tests/test_static.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/tests/test_static.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/tests/test_static.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -1,6 +1,6 @@
#############################################################################
#
-# Copyright (c) 2009 Zope Foundation and Contributors.
+# Copyright (c) 2010 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -16,12 +16,12 @@
import pkg_resources
import shutil
import tempfile
-import time
import unittest
import gocept.selenium.tests.fixture
import gocept.selenium.static
+
class TestStaticFilesLayer(unittest.TestCase):
def setUp(self):
@@ -59,6 +59,7 @@
self.testlayer.stop_server()
self.assert_(not self.testlayer.server)
+
class TestStaticFilesTestCase(gocept.selenium.static.StaticFilesTestCase):
def test_server_started(self):
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/tests/test_util.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/tests/test_util.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/tests/test_util.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -16,19 +16,23 @@
from gocept.selenium.base import Layer
from gocept.selenium.util import make_testsuite
+
class MakeTestSuiteTestCase(unittest.TestCase):
layer = Layer()
def test_one_two_three(self):
self.assert_(True)
+
class Another(unittest.TestCase):
def test_four_five(self):
self.assert_(True)
+
class SubFromMakeTestSuiteTestCase(MakeTestSuiteTestCase):
layer = Layer()
+
class MakeTestSuite(unittest.TestCase):
def test_make_testsuite(self):
@@ -64,7 +68,9 @@
for test in tests:
self.assertEquals('192.168.1.2', test._server)
+
def test_suite():
suite = unittest.TestSuite()
- suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(MakeTestSuite))
+ suite.addTest(
+ unittest.defaultTestLoader.loadTestsFromTestCase(MakeTestSuite))
return suite
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/util.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/util.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/util.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -14,6 +14,7 @@
import unittest
+
def _testcases_for_browser(testcases, browser, app_host, selenium_server):
suite = unittest.TestSuite()
for testcase in testcases:
@@ -24,11 +25,13 @@
# Create a new test class, subclassing the original test case. The
# name of this new class reflects what browser is used.
new_testcase = type(
- testcase.__name__+'_'+browser, (testcase,), {'browser': browser})
+ testcase.__name__ + '_' + browser, (testcase,),
+ {'browser': browser})
suite.addTests(
unittest.defaultTestLoader.loadTestsFromTestCase(new_testcase))
return suite
+
def make_testsuite(testcases, browsers, app_host=None, selenium_server=None):
"""Creates a test suite, where each of the given test cases is replicated
for each of the given browser names.
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/__init__.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/__init__.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/__init__.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -75,4 +75,4 @@
zope.server.http.wsgihttpserver.WSGIHTTPServer,
SwitchableDBApplication,
zope.server.http.commonaccesslogger.CommonAccessLogger,
- 8087, True) # The port number here is just the default value
+ 8087, True) # The port number here is just the default value
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_selenese.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_selenese.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_selenese.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -64,6 +64,7 @@
class Selenese(gocept.selenium.selenese.Selenese):
def get_without_assert_type(self):
pass
+
@gocept.selenium.selenese.assert_type('wrong_type')
def get_with_wrong_assert_type(self):
pass
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_ztk.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_ztk.py 2010-06-14 05:57:38 UTC (rev 113437)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/ztk/tests/test_ztk.py 2010-06-14 05:59:48 UTC (rev 113438)
@@ -15,6 +15,7 @@
import gocept.selenium.ztk.testing
import gocept.selenium.tests.isolation
+
class ZTKTests(gocept.selenium.tests.isolation.IsolationTests,
gocept.selenium.ztk.testing.TestCase):
More information about the checkins
mailing list