class KingDom: def __init__(self, secret_messages): # We can change the parsing methods also in this Data class self.secret_messages = Data(secret_messages) # We can implement any new decoding methods in Message class. self.message_decoder = Message() # We can implement new method ally checking methods in Ally class. self.ally = Ally(self.secret_messages, self.message_decoder) self.ally.check_ally()
def test_check_ally(self): checker = Ally(Data("test_check_ally.txt"), Message()) self.assertTrue("SPACE FIRE WATER AIR", checker.check_ally())