-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
36 lines (34 loc) · 1.73 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import dataset
import bcrypt
install_requires=[
'libsass'
]
if __name__ == "__main__":
taskbook_db = dataset.connect('sqlite:///taskbook.db')
task_table = taskbook_db.get_table('task')
task_table.drop()
task_table = taskbook_db.create_table('task')
task_table.insert_many([
{"time": 0.0, "name": "Do something useful", "day": "today", "email": "[email protected]", "completed": True, "color": "#ffffff", "date": ""},
{"time": 0.5, "name": "Do something fantastic", "day": "today", "email": "[email protected]", "completed": False, "color": "#ffffff", "date": ""},
{"time": 0.3, "name": "Do something remarkable", "day": "tomorrow", "email": "[email protected]", "completed": False, "color": "#ffffff", "date": ""},
{"time": 0.7, "name": "Do something unusual", "day": "tomorrow", "email": "[email protected]", "completed": True, "color": "#ffffff", "date": ""}
])
account_table = taskbook_db.get_table('account')
account_table.drop()
account_table = taskbook_db.create_table('account')
#password = bcrypt.hashpw(b"test", bcrypt.gensalt())
password = bcrypt.hashpw(str.encode("test"), bcrypt.gensalt())
account_table.insert_many([
{"email":"[email protected]", "name": "John Doe", "password": password, "session": ""}
])
user = account_table.find_one(email='[email protected]')
print(user)
if bcrypt.checkpw(str.encode("test"), user["password"]):
print("Password matches!")
else:
print("BCRYPT Not Properly Implemented!!!")
if not bcrypt.checkpw(str.encode("test2"), user["password"]):
print("Password correctly doesn't match!")
else:
print("BCRYPT Not Properly Implemented!!! Incorrect password returned true!")