コード例 #1
0
 def test__load_picture_redirections(self, _generate_card_image, _generate_battle_screen_button_images,
                                     _generate_flags, _generate_crewman):
     redirections = {"crewman1": _generate_crewman, "flag_pirate": _generate_flags,
                     "icon_rifle": _generate_battle_screen_button_images, "event_mutiny": _generate_card_image}
     for special_image_name, method in redirections.items():
         Gallery._load_picture(special_image_name)
         method.assert_called_once()
コード例 #2
0
 def test__load_picture(self, PhotoImage, _ger_raw_image, board_size):
     board_size.return_value = 100
     _ger_raw_image.return_value = self.mock_image
     Gallery._load_picture("map")
     _ger_raw_image.assert_called_with("map")
     board_size.assert_called()
     self.mock_image.resize.assert_called_once_with((100, 100), 1)
     self.assertEqual("photo_data", Gallery._pictures["map"])
コード例 #3
0
 def test__load_picture_flag(self, PhotoImage, _get_raw_image):
     _get_raw_image.return_value = self.mock_image
     Gallery._load_picture("flag_british")
     self.assertEqual("photo_data", Gallery._pictures["flag_pirate"])
コード例 #4
0
 def test__load_picture_wind_direction(self, PhotoImage, _get_raw_image):
     _get_raw_image.return_value = self.mock_image
     Gallery._load_picture("wind_direction5")
     self.assertEqual("photo_data", Gallery._pictures["wind_direction2"])