Permalink
Browse files

PEP8 Fixes

  • Loading branch information...
1 parent 936ac54 commit 17449b8693c3eebba77c49e21b791855616bd209 @retornam retornam committed Sep 3, 2013
View
@@ -18,16 +18,14 @@ def pytest_addoption(parser):
def pytest_configure(config):
config.addinivalue_line(
- 'markers',
- 'bedrock: marks tests so they use Bedrock branch')
+ 'markers',
+ 'bedrock: marks tests so they use Bedrock branch')
def pytest_runtest_setup(item):
- if hasattr(item.obj, 'bedrock') and \
- '/b' not in item.config.option.base_url:
+ if hasattr(item.obj, 'bedrock') and '/b' not in item.config.option.base_url:
item.config.option.base_url = item.config.option.base_url + '/b'
else:
item.config.option.base_url = item.config.option.base_url.replace('/b', '')
- if hasattr(item.obj, 'skipsprod') \
- and 'allizom.org' not in item.config.option.base_url:
+ if hasattr(item.obj, 'skipsprod') and 'allizom.org' not in item.config.option.base_url:
pytest.skip("skipping tests marked staging only")
View
@@ -4,7 +4,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
-from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from pages.desktop.base import Base
@@ -66,4 +65,3 @@ def are_sign_up_form_fields_visible(self):
def expand_sign_up_form(self):
self.selenium.find_element(*self._sign_up_form_email_input_locator).click()
WebDriverWait(self.selenium, self.timeout).until(lambda s: s.find_element(*self._sign_up_form_text_radio_locator))
-
@@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
-from selenium.webdriver.support.select import Select
from pages.desktop.base import Base
from pages.page import Page
View
@@ -20,11 +20,11 @@ def go_to_page(self):
_enable_dnt_link_locator = (By.CSS_SELECTOR, '.sidebar-inset > p > a')
tracking_protection_links_list = [
{
- 'locator': (By.CSS_SELECTOR, '.sidebar-box > p > a:nth-of-type(1)'),
+ 'locator': (By.CSS_SELECTOR, '.sidebar-box > p > a:nth-of-type(1)'),
'url_suffix': 'ie.microsoft.com/testdrive/Browser/TrackingProtectionLists/faq.html'
},
{
- 'locator': (By.CSS_SELECTOR, '.sidebar-box > p > a:nth-of-type(2)'),
+ 'locator': (By.CSS_SELECTOR, '.sidebar-box > p > a:nth-of-type(2)'),
'url_suffix': 'dnt-enabler.tpl'
}
]
@@ -85,14 +85,14 @@ class PartnerForm(Page):
@property
def fields_list(self):
return [
- self._first_name_textbox_locator, self._last_name_textbox_locator,
- self._title_textbox_locator, self._company_textbox_locator,
- self._website_textbox_locator, self._email_textbox_locator,
- self._phone_textbox_locator, self._mobile_textbox_locator,
- self._address_textbox_locator, self._city_textbox_locator,
- self._country_textbox_locator, self._zip_textbox_locator,
- self._interest_field_locator, self._description_textbox_locator
- ]
+ self._first_name_textbox_locator, self._last_name_textbox_locator,
+ self._title_textbox_locator, self._company_textbox_locator,
+ self._website_textbox_locator, self._email_textbox_locator,
+ self._phone_textbox_locator, self._mobile_textbox_locator,
+ self._address_textbox_locator, self._city_textbox_locator,
+ self._country_textbox_locator, self._zip_textbox_locator,
+ self._interest_field_locator, self._description_textbox_locator
+ ]
@property
def is_title_visible(self):
@@ -54,7 +54,7 @@ def go_to_page(self):
}, {
'locator': (By.CSS_SELECTOR, '#innovations li:nth-child(2) a img'),
'img_name_suffix': 'badge-labs.jpg',
- }, {
+ }, {
'locator': (By.CSS_SELECTOR, '#tools li:nth-child(1) a img'),
'img_name_suffix': 'badge-tools.jpg',
}, {
View
@@ -35,7 +35,7 @@ def test_tabzilla_links_are_correct(self, mozwebqa):
bad_links = []
for link in DoNotTrack.Header.tabzilla_links_list:
url = dnt_page.link_destination(link.get('locator'))
- if url.find(link.get('url_suffix')) < 1:
+ if url.find(link.get('url_suffix')) < 1:
bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
@@ -31,7 +31,6 @@ def test_that_response_url_contains_locale_code(self, mozwebqa):
for link in links:
url = link['href']
response = requests.head(url, allow_redirects=True)
- status = response.status_code
if language['id'] not in response.url:
bad_links.append("Lang '%s' not in response: %s \n"
% (language['id'], response.url))
View
@@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
-import requests
from pages.desktop.partners import Partners
from unittestzero import Assert
@@ -36,7 +35,7 @@ def test_tabzilla_links_are_correct(self, mozwebqa):
bad_links = []
for link in Partners.Header.tabzilla_links_list:
url = partners_page.link_destination(link.get('locator'))
- if url.find(link.get('url_suffix')) < 1:
+ if url.find(link.get('url_suffix')) < 1:
bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
View
@@ -35,7 +35,7 @@ def test_tabzilla_links_are_correct(self, mozwebqa):
bad_links = []
for link in Privacy.Header.tabzilla_links_list:
url = privacy_page.link_destination(link.get('locator'))
- if url.find(link.get('url_suffix')) < 1:
+ if url.find(link.get('url_suffix')) < 1:
bad_links.append('%s does not end with %s' % (url, link.get('url_suffix')))
Assert.equal(0, len(bad_links), '%s bad links found: ' % len(bad_links) + ', '.join(bad_links))
View
@@ -131,13 +131,13 @@ def test_all_older_redirect(self, mozwebqa):
url = mozwebqa.base_url + "/firefox/all-older.html"
response = requests.get(url)
Assert.contains("/firefox/new", response.url)
-
+
@pytest.mark.nondestructive
def test_old_firstrun_redirect(self, mozwebqa):
url = mozwebqa.base_url + "/en-US/projects/firefox/3.6.13/firstrun/"
response = requests.get(url)
Assert.not_equal(response.status_code, 404)
-
+
@pytest.mark.nondestructive
def test_old_whatsnew_redirect(self, mozwebqa):
url = mozwebqa.base_url + '/en-US/projects/firefox/3.6.13/whatsnew/'
@@ -20,7 +20,7 @@ class TestRedirectLanding(object):
"lv", "mai", "mk", "ml", "mn", "mr", "nb-NO", "nl", "nn-NO", "nso",
"or", "pa-IN", "pl", "pt-BR", "pt-PT", "rm", "ro", "ru", "si", "sk",
"sl", "son", "sq", "sr", "sv-SE", "sw", "ta", "ta-LK", "te", "th", "tr",
- "uk", "vi", "zh-CN","zh-TW", "zu"
+ "uk", "vi", "zh-CN", "zh-TW", "zu"
)
ACCEPT_LANGUAGE = {'Accept-Language': 'en-US'}
FIREFOX = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20100101 Firefox/23.0'}
@@ -94,7 +94,7 @@ def test_redirect_esr_firefox_using_locale(self, mozwebqa):
headers = {}
headers.update(self.ESR_FIREFOX)
for locale in self.LOCALES:
- if locale in ['zu','ak','lg', 'mai']:
+ if locale in ['zu', 'ak', 'lg', 'mai']:
self.ACCEPT_LANGUAGE['Accept-Language'] = locale
headers.update(self.ACCEPT_LANGUAGE)
self._test_redirect(mozwebqa, '/firefox/', '/firefox/new/', headers)

0 comments on commit 17449b8

Please sign in to comment.