import chatbot_brain

stock = u"What a funny thing to say!"


def test_initialize_bot():
    bot = chatbot_brain.Chatbot()
    assert len(bot.tri_lexicon) == 0
    assert len(bot.bi_lexicon) == 0


def test_fill_lexicon():
    bot = chatbot_brain.Chatbot()
    bot.fill_lexicon()
    assert len(bot.tri_lexicon) > 0
    assert len(bot.bi_lexicon) > 0


def test_compose_response():
    bot = chatbot_brain.Chatbot()
    output = bot.compose_response(input_sent="How are you doing?")
    assert "," not in output[0]
    for sentence in output:
        assert "." not in sentence[:-1]


def test_i_filter_random_empty_words():
    u"""Assert an empty string is not found in the default lexicon."""
    bot = chatbot_brain.Chatbot()
    words = [""]
    assert bot.i_filter_random(words) == stock


def test_i_filter_random_words_not_in_lexicon():
    u"""Assert that if all words are not in lexicon the default is returned."""
    bot = chatbot_brain.Chatbot()
    words = ["moose", "bear", "eagle"]
    bot.bi_lexicon = {"car": "mercedes", "boat": "sail", "train": "track"}
    assert bot.i_filter_random(words) == stock


def test_i_filter_random_words_in_lexicon():
    u"""Assert that if all words are in lexicon, a word is returned."""
    bot = chatbot_brain.Chatbot()
    words = ["car", "boat", "train"]
    bot.bi_lexicon = {"car": "mercedes", "boat": "sail", "train": "track"}
    assert bot.i_filter_random(words) in bot.bi_lexicon


def test_i_filter_random_one_word_in_lexicon():
    u"""Assert that if one word is in lexicon that word is returned"""
    bot = chatbot_brain.Chatbot()
    words = ["car", "bear", "eagle"]
    bot.bi_lexicon = {"car": "mercedes", "boat": "sail", "train": "track"}
    assert bot.i_filter_random(words) == "car"


# untested methods:
# i_filter_random
# o_filter_random
# _create_chains
# _pair_seed
# _chain_filters
# _filter_recursive

@@ -54,16 +54,822 @@
  say!%22%0A%0A
+sentences_ = %5B%0A    %22red coat myself very unwell this morning that has %5C%0A    passed off much better of me if I speak plainer ?%22,%0A    %22red coat myself very unwell this morning that if it is .%22,%0A    %22red coat myself very unwell this morning and pack her trunk afresh.%22,%0A    %22red coat myself very unwell this morning that has passed off pleasantly %5C%0A    to the following morning every hope of an illiterate and miserly father %5C%0A    and mother .%22%22%22,%0A    %22red coat myself very well madam said.%22,%0A    %22red coat myself very well together.%22,%0A    %22red coat myself very unwell this morning.%22,%0A    %22red coat myself very well for the first two months.%22,%0A    %22red coat myself very well that.%22,%0A    %22red coat myself very unwell this morning that if he comes%5C%0A    into the regulars and among his former indolence.%22%0A    %5D%0A%0A
 %0Adef tes
@@ -1651,37 +1651,32 @@
 %0A    u%22%22%22Assert 
-that 
 if all words are
@@ -1976,21 +1976,16 @@
 %22Assert 
-that 
 if all w
@@ -2295,21 +2295,16 @@
 %22Assert 
-that 
 if one w
@@ -2541,16 +2541,261 @@
 %22car%22%0A%0A%0A
+def test_o_filter_random():%0A    u%22%22%22Assert the returned element is in the initial list.%22%22%22%0A%0A%0A        def o_filter_random(self, sentences):%0A        u%22%22%22Return randomly selected sentence from sentecnces%22%22%22%0A        return random.choice(sentences)%0A%0A
 # untest
@@ -2810,26 +2810,8 @@
 ds:%0A
-# i_filter_random%0A
 # o_

Add test sentences to test_chattbot_brain.py