Skip to content

Commit

Permalink
Merge pull request #154 from bbc/jamessa-tests
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
j616 authored Mar 1, 2024
2 parents bf02dd6 + 73308f8 commit 060e1f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit 060e1f1

Please sign in to comment.