Permalink
Browse files

applying some pep8 rules

  • Loading branch information...
1 parent a5e48ce commit db72685ec743262a37cc57e78e4dc66435d5559a @andrewsmedina andrewsmedina committed Nov 16, 2012
@@ -17,6 +17,7 @@
import time
from splinter import Browser
+
class FacebookEventsTestCase(unittest.TestCase):
@classmethod
@@ -13,17 +13,14 @@ class TestGoogleSearch(unittest.TestCase):
def setUpClass(cls):
cls.browser = Browser()
-
@classmethod
def tearDownClass(cls):
cls.browser.quit()
-
def test_visiting_google_com_returns_a_page_with_Google_in_title(self):
self.browser.visit('http://www.google.com/')
self.assertIn('Google', self.browser.title)
-
def test_filling_Splinter_in_the_search_box_returns_Splinter_website(self):
self.browser.visit('http://www.google.com/')
self.browser.fill('q', 'Splinter')
@@ -289,8 +289,8 @@ def switch_to_window(self, window_name):
"""
return self.driver.switch_to_window(window_name)
-class TypeIterator(object):
+class TypeIterator(object):
def __init__(self, element, keys):
self._element = element
View
@@ -20,9 +20,13 @@ def test_element_has_class_when_element_doesnt_have_the_class(self):
self.assertFalse(self.browser.find_by_css('.has-class-first').first.has_class('has-class'))
def test_element_outer_html(self):
- self.assertEqual(self.browser.find_by_id('html-property').first.outer_html,
- u'<div id="html-property" class="outer html classes">inner <div class="inner-html">inner text</div> html test</div>')
+ self.assertEqual(
+ self.browser.find_by_id('html-property').first.outer_html,
+ u'<div id="html-property" class="outer html classes">inner <div class="inner-html">inner text</div> html test</div>'
+ )
def test_element_html(self):
- self.assertEqual(self.browser.find_by_id('html-property').first.html,
- u'inner <div class="inner-html">inner text</div> html test')
+ self.assertEqual(
+ self.browser.find_by_id('html-property').first.html,
+ u'inner <div class="inner-html">inner text</div> html test'
+ )
View
@@ -31,7 +31,7 @@ def test_finding_by_value(self):
"should find elements by value"
value = self.browser.find_by_value('M').first.value
id = self.browser.find_by_id('gender-m')
- self.assertEqual(id.first.value ,value)
+ self.assertEqual(id.first.value, value)
def test_finding_by_id(self):
"should find elements by id"
View
@@ -43,4 +43,3 @@ def test_is_text_not_present_no_body(self):
"returns true if there's no body"
self.browser.visit(EXAMPLE_APP + "/no-body")
self.assertTrue(self.browser.is_text_not_present('No such text'))
-
View
@@ -9,11 +9,11 @@ class PopupWindowsTest(object):
def test_can_work_on_popups(self):
''' Can work on pop-up windows and switch back to the parent '''
- parent_window = self.browser.current_window # Save the parent window
+ parent_window = self.browser.current_window # Save the parent window
self.browser.find_by_id("open-popup").first.click()
for window in self.browser.windows:
- self.browser.switch_to_window(window) # Switch to a different window (the pop-up)
+ self.browser.switch_to_window(window) # Switch to a different window (the pop-up)
# Check if this is the one we want by comparing the title
if self.browser.title == "Pop-up Window":
break
@@ -23,9 +23,9 @@ def test_can_work_on_popups(self):
# break
value = self.browser.find_by_tag('h1').first.value
- self.assertEqual(value, 'Pop-up Example Header') # Proves we can interact with the popup
+ self.assertEqual(value, 'Pop-up Example Header') # Proves we can interact with the popup
self.browser.find_by_id("close-popup").first.click()
- self.browser.switch_to_window(parent_window) # Switch to the main window again
+ self.browser.switch_to_window(parent_window) # Switch to the main window again
value = self.browser.find_by_tag('h1').first.value
- self.assertEqual(value, 'Example Header') # Proves we can interact with the parent
+ self.assertEqual(value, 'Example Header') # Proves we can interact with the parent
View
@@ -21,15 +21,16 @@
from fake_webapp import EXAMPLE_APP
+
class BrowserTest(unittest.TestCase):
def patch_driver(self, pattern):
self.old_import = __builtin__.__import__
def custom_import(name, *args, **kwargs):
- if pattern in name:
- return None
- return self.old_import(name, *args, **kwargs)
+ if pattern in name:
+ return None
+ return self.old_import(name, *args, **kwargs)
__builtin__.__import__ = custom_import
@@ -76,6 +77,7 @@ def test_firefox_chrome_and_zope_testbrowser_should_support_with_statement(self)
with Browser(browser) as internet:
pass
+
class BrowserDeprecationTest(unittest.TestCase):
class Foo(object):
@@ -113,4 +115,3 @@ def test_webdriverchrome_should_be_deprecated(self):
browser.quit()
warning_message = warnings_list[0].message.args[0]
self.assertEqual("'webdriver.chrome' is deprecated, use just 'chrome'", warning_message)
-

0 comments on commit db72685

Please sign in to comment.