Ejemplo n.º 1
0
 def test_automatically_using_different_default_title_type(self):
     """
     Tests changing the default title type by not supplying the default
     title type.
     :return: None
     """
     title = Title({
         TitleType.ENGLISH: "Attack on Titan",
         TitleType.JAPANESE: "進撃の巨人"
     })
     self.assertEqual(title.default, TitleType.ENGLISH)
     title = Title({
         TitleType.JAPANESE: "進撃の巨人"
     })
     self.assertEqual(title.default, TitleType.JAPANESE)
Ejemplo n.º 2
0
 def test_different_default_title_type(self):
     """
     Tests using a different title type
     :return: None
     """
     title = Title({
         TitleType.ENGLISH: "Attack on Titan",
         TitleType.ROMAJI: "Shingeki no Kyojin"
     }, default=TitleType.ENGLISH)
     self.assertEqual(title.default, TitleType.ENGLISH)
Ejemplo n.º 3
0
    def test_setting_titles_with_invalid_types(self):
        """
        Tests that invalid types in title setting parameters raise a TypeError
        :return: None
        """
        title = Title({TitleType.ROMAJI: "Shingeki no Kyojin"})

        for value in [None, 1, 1.1, True]:
            try:
                # noinspection PyTypeChecker
                title.set(value, TitleType.ROMAJI)
                self.fail()
            except TypeError:
                pass