2018-08-10 02:25:55 +00:00
|
|
|
from unittest import TestCase
|
2018-09-10 14:24:15 +00:00
|
|
|
import os
|
2018-08-10 02:25:55 +00:00
|
|
|
from Commands import *
|
2018-09-10 14:24:15 +00:00
|
|
|
from BotConfig import get_config
|
2018-08-10 02:25:55 +00:00
|
|
|
from MinecraftAccountInfoGrabber import *
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
|
|
|
class StressTest(TestCase):
|
|
|
|
def setUp(self):
|
2018-09-10 14:24:15 +00:00
|
|
|
path = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
self.bot_config = get_config('{}/GeoffreyConfig.ini'.format(path))
|
|
|
|
self.commands = Commands(self.bot_config, True)
|
2018-08-10 02:25:55 +00:00
|
|
|
|
|
|
|
def clr_db(self):
|
|
|
|
self.session = self.commands.interface.database.Session()
|
|
|
|
self.commands.interface.database.clear_all(self.session)
|
|
|
|
self.session.close()
|
|
|
|
|
|
|
|
def test_commands(self):
|
|
|
|
self.clr_db()
|
2018-09-10 14:24:15 +00:00
|
|
|
self.commands.register('BirbHD', '143072699567177728')
|
2018-08-10 02:25:55 +00:00
|
|
|
|
|
|
|
for i in range(0, 1000):
|
|
|
|
self.commands.add_shop(0, 0, shop_name='test shop{}'.format(i), discord_uuid='143072699567177728')
|
|
|
|
|
2018-09-10 14:24:15 +00:00
|
|
|
self.commands.find('BirbHD')
|
2018-08-10 02:25:55 +00:00
|
|
|
sleep(0.5)
|
|
|
|
|
|
|
|
def test_mc_query(self):
|
|
|
|
for i in range(0, 1000):
|
|
|
|
grab_playername('fe7e84132570458892032b69ff188bc3')
|
|
|
|
|
|
|
|
sleep(0.1)
|