Skip to content

Commit 2ea38ae

Browse files
author
Emanuele
committed
Prima versione
0 parents  commit 2ea38ae

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

account.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class account:
2+
def check_password_length(self, password):
3+
if len(password) > 8:
4+
return True
5+
else:
6+
return False
7+
8+
if __name__ == '__main__':
9+
accVerify = account()
10+
print('The password length is ' + str(accVerify.check_password_length('offtoschool')))

account.pyc

735 Bytes
Binary file not shown.

account_test.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import unittest
2+
import account as AccountClass
3+
4+
class Test(unittest.TestCase):
5+
accInfo = AccountClass.account()
6+
7+
def test_check_password_length(self):
8+
print("Checking possible passwords\n")
9+
passwordList = ['abeautifulday','astrictboss','alovelyhouse']
10+
11+
for passwd in passwordList:
12+
print("Checking password " + passwd + "\n")
13+
passInfo = self.accInfo.check_password_length(passwd)
14+
self.assertTrue(passInfo)
15+
16+
if __name__ == '__main__':
17+
unittest.main()

0 commit comments

Comments
 (0)