Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #154

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion mediagrains/hypothesis/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,11 @@ def grains_with_data(grain_type):
"""Strategy giving grains which have data payloads filled out using an appropriate strategy for the grain type.

:param grain_type: The type of grains to generate"""
if grain_type in ("audio", "video", "coded_audio", "coded_video"):
if grain_type == "video":
return grains(grain_type, width=16, height=9).flatmap(lambda g: grains_from_template_with_data(g))
elif grain_type == "coded_video":
return grains(grain_type, origin_width=16, origin_height=9).flatmap(lambda g: grains_from_template_with_data(g))
elif grain_type in ("audio", "coded_audio"):
return grains(grain_type).flatmap(lambda g: grains_from_template_with_data(g))
else:
return grains(grain_type)
Expand Down
10 changes: 9 additions & 1 deletion tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ def attribute_and_pairs_of_grains_of_type_differing_only_in_one_attribute(grain_
pairs_of_grains_of_type_differing_only_at_specified_attribute(
grain_type, attr)))

if grain_type in ("audio", "video", "coded_audio", "coded_video"):
if grain_type == "video":
return grain_strat | grains(grain_type, width=16, height=9).flatmap(
lambda g: tuples(
just("data"), pairs_of(grains_from_template_with_data(g))))
elif grain_type == "coded_video":
return grain_strat | grains(grain_type, origin_width=16, origin_height=9).flatmap(
lambda g: tuples(
just("data"), pairs_of(grains_from_template_with_data(g))))
elif grain_type in ("audio", "coded_audio"):
return grain_strat | grains(grain_type).flatmap(
lambda g: tuples(
just("data"), pairs_of(grains_from_template_with_data(g))))
Expand Down