def setUpClass(cls):
        QuestionService.clear_table()
        UserService.clear_table()

        UserService.add_new_user(userId=11)
        UserService.add_new_user(userId=12)

        print('\n[[[   TESTING QuestionService  ]]]\n')
Beispiel #2
0
    def setUpClass(cls):
        GuildUserService.clear_table()
        UserService.clear_table()
        GuildService.clear_table()

        GuildService.add_new_guild(guildId=101)
        GuildService.add_new_guild(guildId=102)
        GuildService.add_new_guild(guildId=103)

        UserService.add_new_user(userId=11)
        UserService.add_new_user(userId=12)
        UserService.add_new_user(userId=13)

        print('\n[[[   TESTING GuildMemberService   ]]]\n')
Beispiel #3
0
 def tearDownClass(cls):
     GuildUserService.clear_table()
     UserService.clear_table()
     GuildService.clear_table()
 def tearDownClass(cls):
     GifGroupService.clear_table()
     UserService.clear_table()
basePath = str(botdb)
basePath = basePath.split("'")[-2]
path1 = basePath.split('\\\\')[:-1] + ['transfer'] + ['botdata.db']
path1 = '\\\\'.join(path1)
path2 = basePath.split('\\\\')[:-1] + ['transfer'] + ['gif_triggers.db']
path2 = '\\\\'.join(path2)

# ========== CONNECTION 1 ===========
connection = sql.connect(path1)
cursor = connection.cursor()
print('connected: ' + path1)

cursor.execute(""" SELECT * FROM userstats """)
data = cursor.fetchall()

UserService.clear_table()
for row in data:
    newUser = User(userId=row[0],
                   exp=row[1],
                   level=row[2],
                   messagesCount=row[3],
                   symbolsCount=row[4],
                   voiceChatTime=row[5])
    newUser.voluteCount = 0
    newUser.expModifier = 0
    UserService.add_new_user(userId=newUser.userId)
    UserService.update_user(user=newUser)

print('data copied')
connection.close()
print('connection closed')
Beispiel #6
0
 def tearDownClass(cls):
     UserVoiceChatService.clear_table()
     UserService.clear_table()