This commit is contained in:
Waylon Walker 2022-03-31 20:20:07 -05:00
commit 38355d2442
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
9083 changed files with 1225834 additions and 0 deletions

View file

@ -0,0 +1,51 @@
import unittest
import platform
class SysfontModuleTest(unittest.TestCase):
def test_create_aliases(self):
import pygame.sysfont
pygame.sysfont.initsysfonts()
pygame.sysfont.create_aliases()
self.assertTrue(len(pygame.sysfont.Sysalias) > 0)
def test_initsysfonts(self):
import pygame.sysfont
pygame.sysfont.initsysfonts()
self.assertTrue(len(pygame.sysfont.get_fonts()) > 0)
@unittest.skipIf("Darwin" not in platform.platform(), "Not mac we skip.")
def test_initsysfonts_darwin(self):
import pygame.sysfont
self.assertTrue(len(pygame.sysfont.get_fonts()) > 10)
def test_sysfont(self):
import pygame.font
pygame.font.init()
arial = pygame.font.SysFont("Arial", 40)
self.assertTrue(isinstance(arial, pygame.font.Font))
@unittest.skipIf(
("Darwin" in platform.platform() or "Windows" in platform.platform()),
"Not unix we skip.",
)
def test_initsysfonts_unix(self):
import pygame.sysfont
self.assertTrue(len(pygame.sysfont.get_fonts()) > 0)
@unittest.skipIf("Windows" not in platform.platform(), "Not windows we skip.")
def test_initsysfonts_win32(self):
import pygame.sysfont
self.assertTrue(len(pygame.sysfont.get_fonts()) > 10)
###############################################################################
if __name__ == "__main__":
unittest.main()