src/account/test/testAccount.py
(Diff revision 9)
|
|
|
128 |
self.assertEqual(field_in_passwd(user_mod.name,6),myshell) |
|
|
129 |
self.assertEqual(field_in_passwd(user_mod.name,5),myhome) |
Magic numbers.
Test for the inverse set of characters would be nice. This asserts, that *one char* usernames are accepted.
src/account/test/testAccount.py
(Diff revision 9)
|
|
|
137 |
badchar = [chr(i) for i in range(1,36) + range(37,48) + range(58,65) + range(91,95) + range(96,97) + range(123,127)] |
These magic numbers are not well readable. Maybe you could use something like:
badchar = [chr(i) for i in xrange(0, 128) if chr(i) not in set(string.ascii_letters + string.digits + '$_')]
If an assertion fails, examiner has to test each character from the badchar set until he finds out, which one caused it. I'd recommend add some description string like:
self.assertEqual(user.rval, -1, 'account with invalid username "%s" created')
- Michal Minar
On September 16th, 2013, 8:57 a.m. UTC, Robin Hack wrote:
Review request for OpenLMI Developers.
By Robin Hack.
Updated Sept. 16, 2013, 8:57 a.m.
Repository:
openlmi-providers
Description
Account: Added QA test for account provider.
|
Diffs
- src/account/test/testAccount.py (PRE-CREATION)
View Diff
|