<s> from unittest import TestCase <EOL> from chatterbot import ChatBot <EOL> import os <EOL> class ChatBotTestCase ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . test_data_directory = '<STR_LIT>' <EOL> self . test_database_name = self . random_string ( ) + "<STR_LIT>" <EOL> if not os . path . exists ( self . test_data_directory ) : <EOL> os . makedirs ( self . test_data_directory ) <EOL> database_path = os . path . join ( <EOL> self . test_data_directory , <EOL> self . test_database_name <EOL> ) <EOL> self . chatbot = ChatBot ( <EOL> "<STR_LIT>" , <EOL> io_adapter = "<STR_LIT>" , <EOL> database = database_path <EOL> ) <EOL> def random_string ( self , start = <NUM_LIT:0> , end = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> from random import randint <EOL> return str ( randint ( start , end ) ) <EOL> def remove_test_data ( self ) : <EOL> import shutil <EOL> if os . path . exists ( self . test_data_directory ) : <EOL> shutil . rmtree ( self . test_data_directory ) <EOL> def tearDown ( self ) : <EOL> """<STR_LIT>""" <EOL> self . chatbot . storage . drop ( ) <EOL> self . remove_test_data ( ) </s>
