Skip to content

Commit

Permalink
[test_ass_document] Add test_get_style_used_with_and_without_collect_…
Browse files Browse the repository at this point in the history
…draw_fonts
  • Loading branch information
moi15moi committed Jul 28, 2023
1 parent 2efe64b commit bce571e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions tests/test_ass_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

# Get ass path used for tests
dir_path = os.path.dirname(os.path.realpath(__file__))
path_ass = os.path.join(dir_path, "ass", "Untitled.ass")

subtitle = AssDocument.from_file(path_ass)


def test_get_style_used():
path_ass = os.path.join(dir_path, "ass", "Style test.ass")
subtitle = AssDocument.from_file(path_ass)

styles = subtitle.get_used_style()

expected_results = {
Expand All @@ -23,3 +23,20 @@ def test_get_style_used():
}

assert styles == expected_results

def test_get_style_used_with_and_without_collect_draw_fonts():
path_ass = os.path.join(dir_path, "ass", "Collect Draw Style test.ass")
subtitle = AssDocument.from_file(path_ass)

styles = subtitle.get_used_style()
expected_results = {
AssStyle("Jester", 700, False): UsageData(set("Test"), {1}),
}
assert styles == expected_results

styles = subtitle.get_used_style(True)
expected_results = {
AssStyle("Jester", 700, False): UsageData(set("Test"), {1}),
AssStyle("testgmail", 700, False): UsageData(set(), {2}),
}
assert styles == expected_results

0 comments on commit bce571e

Please sign in to comment.