Re: [pgAdmin4][RM#3082] Fix PEP-8 issues - Mailing list pgadmin-hackers

From Murtuza Zabuawala
Subject Re: [pgAdmin4][RM#3082] Fix PEP-8 issues
Date
Msg-id CAKKotZQvyzias+C2mNFkbhbaOn3Dxyg20+ha9LVHJBmicbmRLg@mail.gmail.com
Whole thread Raw
In response to Re: [pgAdmin4][RM#3082] Fix PEP-8 issues  (Dave Page <dpage@pgadmin.org>)
Responses Re: [pgAdmin4][RM#3082] Fix PEP-8 issues  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Hi Dave,

PFA updated patch.

On Mon, Feb 5, 2018 at 7:55 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Feb 2, 2018 at 5:46 PM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

PFA patch to fix PEP-8 issues in feature_tests, dashboard, about and misc module's python code.

To verify the changes,
1) activate virtual environemt
2) Navigate to ../web directory and run following
pycodestyle --config=.pycodestyle ./pgadmin/misc/
pycodestyle --config=.pycodestyle ./pgadmin/about/
pycodestyle --config=.pycodestyle ./pgadmin/dashboard/
pycodestyle --config=.pycodestyle ./pgadmin/feature_tests/

I seem to be getting the following failure pretty consistently with this patch applied:

======================================================================
ERROR: runTest (pgadmin.feature_tests.pg_datatype_validation_test.PGDataypeFeatureTest)
Test checks for PG data-types output
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_datatype_validation_test.py", line 135, in runTest
    self._check_datatype()
  File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_datatype_validation_test.py", line 161, in _check_datatype
    query = self.construct_select_query(batch)
  File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_datatype_validation_test.py", line 214, in construct_select_query
    if not self._is_datatype_available_in_current_database(datatype):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/feature_tests/pg_datatype_validation_test.py", line 252, in _is_datatype_available_in_current_database
    valid_version = self.database_version >= type_minimum_version[datatype]
KeyError: u''
Fixed
 

----------------------------------------------------------------------
Ran 10 tests in 209.730s

FAILED (errors=1, skipped=1)

======================================================================
Test Result Summary
======================================================================

Regression - PG 10:

8 tests passed
1 test failed:
PGDataypeFeatureTest (Test checks for PG data-types output)
1 test skipped:
CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS)

======================================================================

I also got the following whilst testing:

(pgadmin4)piranha:web dpage$ pycodestyle --config=.pycodestyle ./pgadmin/feature_tests/
./pgadmin/feature_tests/keyboard_shortcut_test.py:33: [E501] line too long (95 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:34: [E501] line too long (95 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:42: [E501] line too long (87 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:51: [E501] line too long (114 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:54: [E501] line too long (90 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:69: [E501] line too long (91 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:75: [E501] line too long (89 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:82: [E501] line too long (100 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:90: [E501] line too long (86 > 79 characters)
./pgadmin/feature_tests/keyboard_shortcut_test.py:95: [W391] blank line at end of file
9       E501 line too long (95 > 79 characters)
1       W391 blank line at end of file
10
 
​This file was added after I sent the patch :)​
 
​BTW I have the issues now.​

 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgadmin-hackers by date:

Previous
From: Murtuza Zabuawala
Date:
Subject: Re: [pgAdmin4][RM#2901] Make shortcuts configurable in Debugger
Next
From: Khushboo Vashi
Date:
Subject: Re: [pgAdmin4][Patch]: RM #2899: Provide access keys/shortcuts to allcommonly used menu options in the main window.