class TranslatorTests(TestCase):

    lookup_table = {u"Brot": (Noun(u"Brot", gender=Noun.NEUTRAL), Translation(u"roll")),
                    u"gnadenlos": (Adjective(u"gnadenlos"), Translation(u"merciless")),
                    }


    def setUp(self):

        super(TranslatorTests, self).setUp()
        self.translator = Translator(self.lookup_table)

    def test_lookup(self):

        expected = (Noun(u"Brot", gender=Noun.NEUTRAL,),
                    Translation(u"roll"))
        self.assertEqual(expected, self.translator.lookup(u"Brot"))

    def test_uncapitalized_noun(self):
        """
        Nouns shouldn't have to be capitalized when input.
        """
        expected = (Noun(u"Brot", gender=Noun.NEUTRAL),
                    Translation(u"roll"))
        self.assertEqual(expected, self.translator.lookup(u"brot"))

    def test_capitalized_non_noun(self):
        expected = (Adjective(u"gnadenlos"),
                    Translation(u"merciless"))
        self.assertEqual(expected, self.translator.lookup(u"Gnadenlos"))

    def test_partial_lookup(self):

        self.translator.lookup(u"bloße")
        self.translator.lookup(u"Zugeh")
    def setUp(self):

        super(TranslatorTests, self).setUp()
        self.translator = Translator(self.lookup_table)