You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/10 22:45:05 UTC

[allura] 34/41: [#8349] python-modernize -n -w --no-diffs -f file .

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8349
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 487829a9aed0b9398b5caa78869337aa11e47072
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Feb 10 15:35:04 2020 -0500

    [#8349] python-modernize -n -w --no-diffs -f file .
---
 Allura/allura/tests/functional/test_admin.py            |  6 +++---
 Allura/allura/tests/functional/test_home.py             |  2 +-
 Allura/allura/tests/functional/test_neighborhood.py     |  4 ++--
 ForgeTracker/forgetracker/tests/functional/test_root.py | 16 ++++++++--------
 ForgeWiki/forgewiki/tests/functional/test_rest.py       |  2 +-
 ForgeWiki/forgewiki/tests/functional/test_root.py       | 10 +++++-----
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index 6db9053..a55b062 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -372,7 +372,7 @@ class TestProjectAdmin(TestController):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(
             allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('icon', file_name, file_data)
 
         self.app.get('/admin/')
@@ -396,7 +396,7 @@ class TestProjectAdmin(TestController):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(
             allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('screenshot', file_name, file_data)
 
         self.app.get('/admin/')
@@ -436,7 +436,7 @@ class TestProjectAdmin(TestController):
         for file_name in ('admin_24.png', 'admin_32.png'):
             file_path = os.path.join(allura.__path__[0], 'nf', 'allura',
                                      'images', file_name)
-            file_data = file(file_path).read()
+            file_data = open(file_path).read()
             upload = ('screenshot', file_name, file_data)
             self.app.post('/admin/add_screenshot', params=dict(
                 caption=file_name),
diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py
index dc523c2..6955a67 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -157,7 +157,7 @@ class TestProjectHome(TestController):
     def test_user_icon(self):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('icon', file_name, file_data)
         with td.audits('update project icon'):
             self.app.post('/u/test-admin/admin/update', params=dict(
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index ce23cbe..672662c 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -266,7 +266,7 @@ class TestNeighborhood(TestController):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(
             allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('icon', file_name, file_data)
 
         r = self.app.get('/adobe/_admin/', extra_environ=dict(username=str('root')))
@@ -869,7 +869,7 @@ class TestNeighborhood(TestController):
         file_name = 'adobe_icon.png'
         file_path = os.path.join(
             allura.__path__[0], 'public', 'nf', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('icon', file_name, file_data)
 
         r = self.app.get('/adobe/_admin/awards',
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 32b3942..c8e7ae1 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -880,7 +880,7 @@ class TestFunctionalController(TrackerTestController):
 
     def test_new_attachment(self):
         file_name = 'test_root.py'
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         upload = ('attachment', file_name, file_data)
         self.new_ticket(summary='test new attachment')
         ticket_editor = self.app.post('/bugs/1/update_ticket', {
@@ -895,7 +895,7 @@ class TestFunctionalController(TrackerTestController):
 
     def test_delete_attachment(self):
         file_name = 'test_root.py'
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         upload = ('attachment', file_name, file_data)
         self.new_ticket(summary='test new attachment')
         ticket_editor = self.app.post('/bugs/1/update_ticket', {
@@ -940,7 +940,7 @@ class TestFunctionalController(TrackerTestController):
 
     def test_new_text_attachment_content(self):
         file_name = 'test_root.py'
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         upload = ('attachment', file_name, file_data)
         self.new_ticket(summary='test new attachment')
         ticket_editor = self.app.post('/bugs/1/update_ticket', {
@@ -953,7 +953,7 @@ class TestFunctionalController(TrackerTestController):
     def test_two_attachments(self):
         file_name1 = 'test_root1.py'
         file_name2 = 'test_root2.py'
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         self.new_ticket(summary='test new attachment')
         ticket_editor = self.app.post('/bugs/1/update_ticket', {
             'summary': 'zzz'
@@ -967,7 +967,7 @@ class TestFunctionalController(TrackerTestController):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(
             allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('attachment', file_name, file_data)
         self.new_ticket(summary='test new attachment')
         self.app.post('/bugs/1/update_ticket', {
@@ -1672,7 +1672,7 @@ class TestFunctionalController(TrackerTestController):
 
     def test_new_ticket_notification_contains_attachments(self):
         file_name = 'tést_root.py'.encode('utf-8')
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         upload = ('ticket_form.attachment', file_name, file_data)
         r = self.app.post('/bugs/save_ticket', {
             'ticket_form.summary': 'new ticket with attachment'
@@ -2366,7 +2366,7 @@ class TestFunctionalController(TrackerTestController):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(
             allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('attachment', file_name, file_data)
         self.new_ticket(summary='test move attachment')
 
@@ -2466,7 +2466,7 @@ class TestFunctionalController(TrackerTestController):
                      11)
 
         file_name = 'test_root.py'
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         upload = ('attachment', file_name, file_data)
         r = self.app.post('/bugs/1/update_ticket', {
             'summary': 'test rest attach'
diff --git a/ForgeWiki/forgewiki/tests/functional/test_rest.py b/ForgeWiki/forgewiki/tests/functional/test_rest.py
index e29375d..70e08ca 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_rest.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_rest.py
@@ -48,7 +48,7 @@ class TestWikiApi(TestRestApiBase):
     def test_get_page(self):
         r = self.app.get('/p/test/wiki/Home/')
         discussion_url = r.html.find('form', id='edit_post')['action'][:-4]
-        content = file(__file__).read()
+        content = open(__file__).read()
         self.app.post('/wiki/Home/attach',
                       upload_files=[('file_info', 'test_root.py', content)])
         r = self.app.get('/rest/p/test/wiki/Home/')
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index f917c1e..b41ae5e 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -494,7 +494,7 @@ class TestRootController(TestController):
                 'text': 'sometext',
                 'labels': '',
                 })
-        content = file(__file__).read()
+        content = open(__file__).read()
         self.app.post(h.urlquote('/wiki/tést/attach'),
                       upload_files=[('file_info', 'test_root.py', content)])
         response = self.app.get(h.urlquote('/wiki/tést/'))
@@ -508,7 +508,7 @@ class TestRootController(TestController):
                 'text': 'sometext',
                 'labels': '',
                 })
-        content = file(__file__).read()
+        content = open(__file__).read()
         self.app.post(h.urlquote('/wiki/tést/attach'),
                       upload_files=[('file_info', 'test1.py', content), ('file_info', 'test2.py', content)])
         response = self.app.get(h.urlquote('/wiki/tést/'))
@@ -524,7 +524,7 @@ class TestRootController(TestController):
                 'labels': '',
                 })
         file_name = 'test_root.py'
-        file_data = file(__file__).read()
+        file_data = open(__file__).read()
         upload = ('file_info', file_name, file_data)
         self.app.post(h.urlquote('/wiki/tést/attach'), upload_files=[upload])
         page_editor = self.app.get(h.urlquote('/wiki/tést/edit'))
@@ -540,7 +540,7 @@ class TestRootController(TestController):
         file_name = 'neo-icon-set-454545-256x350.png'
         file_path = os.path.join(
             allura.__path__[0], 'nf', 'allura', 'images', file_name)
-        file_data = file(file_path).read()
+        file_data = open(file_path).read()
         upload = ('file_info', file_name, file_data)
         self.app.post('/wiki/TEST/attach', upload_files=[upload])
         h.set_context('test', 'wiki', neighborhood='Projects')
@@ -713,7 +713,7 @@ class TestRootController(TestController):
             'labels': '',
             }
         self.app.post('/wiki/TEST/update', params=params)
-        content = file(__file__).read()
+        content = open(__file__).read()
         self.app.post('/wiki/TEST/attach',
                       upload_files=[('file_info', 'test_root.py', content)])
         r = self.app.get('/wiki/TEST/')