<reponame>machinelearningdeveloper/aoc_2016<filename>06/test_message.py
import unittest

from message import recover_message, load_messages


class TestMessage(unittest.TestCase):
    def setUp(self):
        self.messages = ['eedadn', 'drvtee', 'eandsr',
                         'raavrd', 'atevrs', 'tsrnev',
                         'sdttsa', 'rasrtv', 'nssdts',
                         'ntnada', 'svetve', 'tesnvt',
                         'vntsnd', 'vrdear', 'dvrsen',
                         'enarar']

    def test_recover_message(self):
        assert recover_message(self.messages) == 'easter'
        assert recover_message(self.messages, least_frequent=True) == 'advent'


    def test_load_messages(self):
        assert len(load_messages())

import unittest

from message import recover_message, load_messages


class TestMessage(unittest.TestCase):
    def setUp(self):
        self.messages = ['eedadn', 'drvtee', 'eandsr',
                         'raavrd', 'atevrs', 'tsrnev',
                         'sdttsa', 'rasrtv', 'nssdts',
                         'ntnada', 'svetve', 'tesnvt',
                         'vntsnd', 'vrdear', 'dvrsen',
                         'enarar']

    def test_recover_message(self):
        assert recover_message(self.messages) == 'easter'
        assert recover_message(self.messages, least_frequent=True) == 'advent'


    def test_load_messages(self):
        assert len(load_messages())