Exemple #1
0
 def test_ask(self):
     good, bad = tone_analyzer.load_thoughts()
     player = 'Human'
     host = 'Bot'
     the_game = game.Game(player, host, good, bad)
     new_round = game.Round(the_game, 1)
     new_round._ask_question(1)
Exemple #2
0
 def test_create_round(self):
     good, bad = tone_analyzer.load_thoughts()
     player = 'Human'
     host = 'Bot'
     the_game = game.Game(player, host, good, bad)
     new_round = game.Round(the_game, 1)
     self.assertGreater(len(new_round.host_thoughts), 0)
     self.assertGreater(len(new_round.good_thoughts), 0)
Exemple #3
0
    def test_absorb_thoughts(self):
        brain = tone_analyzer.Brain('Name')
        thought_list = tone_analyzer.load_thoughts()[0]
        brain.absorb_thoughts(thought_list, 'Good')
        thought_result = brain.get_thoughts()

        for t in thought_result:
            self.assertIn(t.thought, thought_list)
Exemple #4
0
 def test_create_game(self):
     good, bad = tone_analyzer.load_thoughts()
     player = 'Human'
     host = 'Bot'
     the_game = game.Game(player, host, good, bad)
     print the_game
     self.assertEqual(the_game.player_name, player)
     print the_game.player_brain
     self.assertEqual(the_game.host_name, host)
     print the_game.host_brain
Exemple #5
0
    def test_overall_thought_tone(self):
        brain = tone_analyzer.Brain('Test')
        good, bad = tone_analyzer.load_thoughts()
        brain.absorb_thoughts(good[:5])
        brain.absorb_thoughts(bad[:5])
        print "Overall Tone"
        print brain.overall_thought_tone
        # print a 2nd time to test caching.
        print brain.overall_thought_tone
        print brain.overall_thought_score

        print brain.alignment
Exemple #6
0
 def test_load_thoughts(self):
     good, bad = tone_analyzer.load_thoughts()
     self.assertIn('I am worth it.', good)
     self.assertIn('I am unlovable.', bad)