forked from pontius-varo/MundusBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nirntests.py
81 lines (58 loc) · 2.34 KB
/
nirntests.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from random import randint
import unittest
from lib import utilities
from lib import mundusfuncs
# test_connection = utilities.create_connection("db/neodatabase")
class NirnTest(unittest.TestCase):
def test_isTokenAvailable(self):
token = utilities.returnSetting('server_token')
self.assertTrue(token[1], token[0])
# The functions within SCRIPT.PY need to be rewritten in order to return
# values that can be tested using the NirnTest object
# Function for GetUser
# def test_getUserTest(self):
# # Testing username saved in every database
# username = '@nirnbot'
# # Check if the query is executed successfully
# result = mundusfuncs.getUserInfo(username, test_connection)
# self.assertTrue(result[1], result[0])
# Function for AddUser
# def test_addUserTest(self):
# # Dummy username
# username = '@anoymous' + str(randint(1, 1000))
# # Get the result
# result = mundusfuncs.addUsertoDb(username, test_connection)
# # Test the result
# self.assertTrue(result[1], result[0])
# Function for Add Info
# def test_addDataTest(self):
# # Dummy username
# username = '@nirnbot'
# result = mundusfuncs.addData(
# username, ['website', 'https://dummy.org/'], test_connection)
# self.assertTrue(result[1], result[0])
# Function for UpdateStatus
# def test_updateStatusTest(self):
# # Dummy username
# username = '@nirnbot'
# result = mundusfuncs.updateUserStatus(
# username, 'Testing...', test_connection)
# self.assertTrue(result[1], result[0])
# Function for Get Status
# def test_getStatusTest(self):
# # Dummy Username
# username = '@nirnbot'
# result = mundusfuncs.getUserStatus(username, test_connection)
# self.assertTrue(result[1], result[0])
# Function for Get Gas
def test_getGas(self):
result = mundusfuncs.returnGas()
self.assertTrue(result[1], result[0])
# Function for Display All Users
# def test_firstAdmin(self):
# # Dummy usernamer, should return false
# username = '@nirnbot'
# result = mundusfuncs.displayAll(username, test_connection)
# self.assertFalse(result[1], result[0])
if __name__ == '__main__':
unittest.main()