Skip to content

Commit

Permalink
Merge branch 'main' into repr2
Browse files Browse the repository at this point in the history
* main:
  Adds update dependencies workflow (#20)
  🌱 Seed (#21)
  • Loading branch information
mrharpo committed Apr 14, 2023
2 parents a2d05a8 + b346248 commit 6302af1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 🛍 Update dependencies
# On Wednesdays, we update our dependencies.

on:
workflow_dispatch:
schedule:
- cron: 0 12 * * 3

jobs:
update:
name: 🦿 Update dependencies
uses: WGBH-MLA/.github/.github/workflows/update.yml@main
9 changes: 9 additions & 0 deletions tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ def pipelines(self, create, extracted, **kwargs):
for pipeline in extracted:
self.pipelines.append(pipeline)

@factory.post_generation
def pipelines(self, create, extracted, **kwargs):
if not create:
return

if extracted:
for pipeline in extracted:
self.pipelines.append(pipeline)


class PipelineFactory(ChowdaFactory):
class Meta:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ClamsApp,
Pipeline,
ClamsEvent,
AppStatus,
)
from factories import (
MediaFileFactory,
Expand All @@ -15,6 +16,7 @@
PipelineFactory,
ClamsEventFactory,
)
from random import choice


def test_media_file_factory():
Expand Down Expand Up @@ -61,8 +63,9 @@ def test_clams_event_factory():
pipeline = PipelineFactory.create(clams_apps=[clams_app])
media_file = MediaFileFactory.create()
batch = BatchFactory.create(media_files=[media_file], pipeline=pipeline)
status = choice(list(AppStatus)).value
clams_event = ClamsEventFactory.create(
media_file=media_file, batch=batch, clams_app=clams_app
media_file=media_file, batch=batch, clams_app=clams_app, status=status
)
assert type(clams_event) is ClamsEvent
assert_related(clams_event, batch=batch, media_file=media_file, clams_app=clams_app)
Expand Down

0 comments on commit 6302af1

Please sign in to comment.