[pythonwifi] [Fwd: Feedback on get_nic_names_proc] |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/pythonwifi Archives
]
Of course, after saying I wanted to keep PW discussion public, my first
message was sent private...
---------------------------- Original Message ----------------------------
Subject: Feedback on get_nic_names_proc
From: "Sean Robinson" <robinson@xxxxxxxxxxxxx>
Date: Sat, April 18, 2015 5:05 pm
To: "Christoffer Jerkeby" <kugghjul@xxxxxxxxx>
--------------------------------------------------------------------------
Christoffer,
I looked through your first several kugg/api2011 commits and developed
some patches (in the skr-exp-refactor-get_nic_names_proc branch) as
feedback. This email is about get_nic_names_proc, but the patterns can be
applied to other functions and tests in the package.
I started by writing an expanded set of test cases[0] for the function so
that I could verify my later changes would not break the API for the
function.
The second patch[1] re-factors get_nic_names_proc to avoid the try..except
block. The try..except inside a for loop caught my attention. The
exception should only trigger on the first two lines -- the expected
condition is success -- so I recommend not setting up and tearing down the
try..except block when it is not expected to be used.
[0]
http://git.tuxfamily.org/pythonwifi/pythonwifi.git/commit/?h=skr-exp-refactor-get_nic_names_proc&id=ac822e708c831f266d55d3e3ec567a6ee2303ffb
[1]
http://git.tuxfamily.org/pythonwifi/pythonwifi.git/commit/?h=skr-exp-refactor-get_nic_names_proc&id=120872daa11c59b26d84a88aa7bd9679aafc55af