Skip to content

Commit

Permalink
Adding tests for skia.FontMgr.New_Custom_Empty/skia.FontMgr.OneFontMgr
Browse files Browse the repository at this point in the history
  • Loading branch information
HinTak committed Aug 12, 2024
1 parent 14c0518 commit 72d36fc
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/test_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,33 @@ def fontmgr():
return skia.FontMgr()


def test_FontMgr_New_Custom_Empty0():
assert isinstance(skia.FontMgr.New_Custom_Empty(), skia.FontMgr)


def test_FontMgr_New_Custom_Empty1(ttf_path):
assert isinstance(skia.FontMgr.New_Custom_Empty(ttf_path), skia.FontMgr)


def test_FontMgr_New_Custom_Empty2(ttf_path):
font_data = skia.Data.MakeFromFileName(ttf_path)
assert isinstance(skia.FontMgr.New_Custom_Empty(font_data), skia.FontMgr)


# Strickly speaking, we do not need/want this no-arg one.
def test_FontMgr_OneFontMgr0():
assert isinstance(skia.FontMgr.OneFontMgr(), skia.FontMgr)


def test_FontMgr_OneFontMgr1(ttf_path):
assert isinstance(skia.FontMgr.OneFontMgr(ttf_path), skia.FontMgr)


def test_FontMgr_OneFontMgr2(ttf_path):
font_data = skia.Data.MakeFromFileName(ttf_path)
assert isinstance(skia.FontMgr.OneFontMgr(font_data), skia.FontMgr)


def test_FontMgr_getitem(fontmgr):
assert isinstance(fontmgr[0], str)

Expand Down

0 comments on commit 72d36fc

Please sign in to comment.