Exemplo n.º 1
0
    def test_link_palette_audit(self):
        PALETTES_TO_CHECK = [
            [],
            ["power_gloves"],
            ["titan_gloves"],
            ["blue_mail", "titan_gloves"],
            ["blue_mail", "power_gloves"],
            ["blue_mail"],
            ["red_mail"],
            ["red_mail", "power_gloves"],
            ["red_mail", "titan_gloves"],
            ["titan_gloves"],
        ]
        link_sprite = link_sprite_library.Sprite(LINK_FILENAME,
                                                 {"name": "Link"},
                                                 LINK_RESOURCE_SUBPATH)

        old_image = None
        for i in range(0, len(PALETTES_TO_CHECK)):
            new_image = link_sprite.get_image("Stand", "right", 0,
                                              PALETTES_TO_CHECK[i], 0)[0]
            if old_image is not None:
                with self.subTest(new_palette=PALETTES_TO_CHECK[i],
                                  old_palette=PALETTES_TO_CHECK[i - 1]):
                    self.assertFalse(self.image_is_same(old_image, new_image))
            old_image = new_image
Exemplo n.º 2
0
 def test_link_zspr_export(self):
     link_sprite = link_sprite_library.Sprite(LINK_FILENAME,
                                              {"name": "Link"},
                                              LINK_RESOURCE_SUBPATH)
     _, temporary_zspr_filename = tempfile.mkstemp()
     self.assertTrue(link_sprite.save_as_ZSPR(temporary_zspr_filename))
     with open(LINK_FILENAME, "rb") as original_file_contents:
         with open(temporary_zspr_filename, "rb") as temp_zspr:
             self.assertTrue(self.same(original_file_contents, temp_zspr))
Exemplo n.º 3
0
 def test_link_rdc_export(self):
     link_sprite = link_sprite_library.Sprite(LINK_FILENAME,
                                              {"name": "Link"},
                                              LINK_RESOURCE_SUBPATH)
     _, temporary_rdc_filename = tempfile.mkstemp()
     self.assertTrue(link_sprite.save_as_RDC(temporary_rdc_filename))
     LINK_RDC_FILENAME = os.path.join(LINK_RESOURCE_PATH, "sheets",
                                      "link.rdc")
     with open(LINK_RDC_FILENAME, "rb") as original_file_contents:
         with open(temporary_rdc_filename, "rb") as temp_rdc:
             self.assertTrue(self.same(original_file_contents, temp_rdc))