diff options
author | zori@chromium.org <zori@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 18:43:07 +0000 |
---|---|---|
committer | zori@chromium.org <zori@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-14 18:43:07 +0000 |
commit | 75a84a2d5fbd4a3cede9b4ed288cca3a5ff4779d (patch) | |
tree | 7b87100713fe77bdca6454a5f3a058337fe696b1 /chrome | |
parent | fb6b1631e32720a196a97b5cfc63b7bc67a9a6eb (diff) | |
download | chromium_src-75a84a2d5fbd4a3cede9b4ed288cca3a5ff4779d.zip chromium_src-75a84a2d5fbd4a3cede9b4ed288cca3a5ff4779d.tar.gz chromium_src-75a84a2d5fbd4a3cede9b4ed288cca3a5ff4779d.tar.bz2 |
Refactoring - in python2 |file| is a constructor function for the file type, so it is better to use another name for a temporary variable.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/10458070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/test/webdriver/test/chromedriver_tests.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/test/webdriver/test/chromedriver_tests.py b/chrome/test/webdriver/test/chromedriver_tests.py index 3f3a86d..d011261 100644 --- a/chrome/test/webdriver/test/chromedriver_tests.py +++ b/chrome/test/webdriver/test/chromedriver_tests.py @@ -807,14 +807,14 @@ class FileUploadControlTest(ChromeDriverTest): """Verify a file path is set to the file upload control.""" self._driver.get(self.GetTestDataUrl() + '/upload.html') - file = tempfile.NamedTemporaryFile() + tmp_file = tempfile.NamedTemporaryFile() fileupload_single = self._driver.find_element_by_name('fileupload_single') multiple = fileupload_single.get_attribute('multiple') self.assertEqual('false', multiple) - fileupload_single.send_keys(file.name) + fileupload_single.send_keys(tmp_file.name) path = fileupload_single.get_attribute('value') - self.assertTrue(path.endswith(os.path.basename(file.name))) + self.assertTrue(path.endswith(os.path.basename(tmp_file.name))) def testSetMultipleFilePathsToFileuploadControlWithoutMultipleWillFail(self): """Verify setting file paths to the file upload control without 'multiple' @@ -824,11 +824,11 @@ class FileUploadControlTest(ChromeDriverTest): files = [] filepaths = [] for index in xrange(4): - file = tempfile.NamedTemporaryFile() + tmp_file = tempfile.NamedTemporaryFile() # We need to hold the file objects because the files will be deleted on # GC. - files.append(file) - filepath = file.name + files.append(tmp_file) + filepath = tmp_file.name filepaths.append(filepath) fileupload_single = self._driver.find_element_by_name('fileupload_single') @@ -845,9 +845,9 @@ class FileUploadControlTest(ChromeDriverTest): filepaths = [] filenames = set() for index in xrange(4): - file = tempfile.NamedTemporaryFile() - files.append(file) - filepath = file.name + tmp_file = tempfile.NamedTemporaryFile() + files.append(tmp_file) + filepath = tmp_file.name filepaths.append(filepath) filenames.add(os.path.basename(filepath)) |