Beispiel #1
0
    def test_print_unused_loaded_fonts(self, _init_pygame, default_ui_manager,
                                       capsys):

        font_dictionary = UIFontDictionary()
        font_dictionary.add_font_path(
            font_name='roboto', font_path='tests/data/Roboto-Regular.ttf')
        font_dictionary.preload_font(font_name='roboto', font_size=14)
        font_dictionary.print_unused_loaded_fonts()
        captured = capsys.readouterr()

        assert captured.out == 'Unused font ids:\nroboto_regular_14(HTML size: 4)\n'
    def test_print_unused_loaded_fonts(self, _init_pygame, capsys):
        loader = BlockingThreadedResourceLoader()
        font_dictionary = UIFontDictionary(loader, locale='en')
        font_dictionary.add_font_path(
            font_name='roboto', font_path='tests/data/Roboto-Regular.ttf')
        font_dictionary.preload_font(font_name='roboto', font_size=14)

        loader.start()
        loader.update()

        font_dictionary.print_unused_loaded_fonts()
        captured = capsys.readouterr()

        assert captured.out == 'Unused font ids:\nroboto_regular_14(HTML size: 4)\n'