Closed Bug 570246 Opened 16 years ago Closed 16 years ago

Python Selenium RC Review: locale_redirect

Categories

(Testing Graveyard :: WebQA, defect)

x86
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tgavankar, Unassigned)

References

Details

Attachments

(1 file)

Attached file locale_redirect
Python test locale_redirect for review From bug 548439
Attachment #449374 - Flags: review?(vish.mozilla)
you should check for several locales. 1. check for several/all xy-ZW locales where xy-ZW is not a valid locale but xy is. so it should redirect to xy 2. check for several/all xy-ZW locales where xy-ZW is a valid locale. so it not redirect further to xy 3. check for a few xy-ZW locales where ZW & xy both are invalid. in this case it should redirect to en-US.
Comment on attachment 449374 [details] locale_redirect from selenium import selenium import vars import unittest class local_redirect(unittest.TestCase): def setUp(self): self.selenium = selenium(vars.ConnectionParameters.server, vars.ConnectionParameters.port, vars.ConnectionParameters.browser, vars.ConnectionParameters.baseurl) self.selenium.start() self.selenium.set_timeout(vars.ConnectionParameters.page_load_timeout) def test_locale_redirect(self): sel = self.selenium sel.open(vars.ConnectionParameters.authurl) sel.open(vars.ConnectionParameters.authurlssl) locales = [ "sq", "ar", "as", "ast", "eu", "bn-BD", "bn-IN", "bs", "pt-BR", "bg", "ca", "hr", "da", "eo", "et", "fi", "fr", "fy-NL", "fur", "gl", "el", "gu-IN", "he", "hi-IN", "hu", "is", "ilo", "id", "ga-IE", "kn", "kk", "rw", "lt", "mk", "ms", "mr", "mn", "no", "oc", "or", "pa-IN", "sb", "pl", "pt-PT", "ro", "rm", "gd", "sr-CYRL", "zh-CN", "si", "sk", "sv-SE", "ta-LK", "te", "th", "zh-TW", "vi", "cy" ] for locale in locales: print locale if "-" in locale: #check existing locales don't redirect sel.open("/" + locale) self.failUnless("/" + locale in sel.get_location()) else: #check redirect for existing xy when xy-ZW does not exist sel.open("/" + locale + "-AA") self.failUnless("/" + locale + "/" in sel.get_location()) #check if nonexistant locales redirect to en-US sel.open("/ze") self.failUnless("/en-US/" in sel.get_location()) def tearDown(self): self.selenium.stop() if __name__ == "__main__": unittest.main()
Hm guess you can't edit attachments, whoops. Anyway, comment above has the fixes you requested. r? on that but just mark it for the original attachment.
Comment on attachment 449374 [details] locale_redirect Awesome!
Attachment #449374 - Flags: review?(vish.mozilla) → review+
Committed to SVN
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: