Skip to content

Commit

Permalink
tests for the addition of filter out <event types> (nowcast runs)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillipsOwen committed Jun 27, 2023
1 parent c0b2b76 commit 017ca58
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/test/test_psc_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,34 @@ def test_push_to_psc():
# set the expected number of records returned
limit = 5

# get the catalog data
catalog_data: dict = psc_sync.db_info.get_catalog_member_records(limit=limit)
# init the catalog data
catalog_data: dict = {}

# init some PSC runs
psc_runs = ['4409-003-ofcl-maxwvel63', '4409-006-ofcl-maxwvel63', '4409-006-ofcl-swan', '4409-006-ofcl-maxele63', '4409-003-ofcl-swan',
'4409-003-ofcl-obs', '4409-006-ofcl-obs', '4409-007-nowcast-swan', '4409-007-nowcast-maxwvel63', '4409-007-nowcast-maxele63',
'4409-007-nowcast-obs', '4409-008-nowcast-swan', '4409-008-nowcast-maxele63', '4409-008-nowcast-maxwvel63', '4409-008-nowcast-obs',
'4409-007-ofcl-swan', '4409-007-ofcl-maxwvel63', '4409-007-ofcl-maxele63', '4409-007-ofcl-obs', '4409-008-ofcl-swan',
'4409-008-ofcl-maxele63', '4409-008-ofcl-maxwvel63', '4409-008-ofcl-obs', '4409-009-nowcast-swan', '4409-009-nowcast-maxele63',
'4409-009-nowcast-maxwvel63', '4409-009-nowcast-obs', '4409-010-nowcast-swan', '4409-010-nowcast-maxele63',
'4409-010-nowcast-maxwvel63', '4409-010-nowcast-obs', '4409-009-ofcl-maxele63', '4409-009-ofcl-swan', '4409-009-ofcl-maxwvel63',
'4409-009-ofcl-obs', '4409-010-ofcl-maxele63', '4409-010-ofcl-maxwvel63', '4409-010-ofcl-swan', '4409-010-ofcl-obs',
'4409-011-nowcast-swan', '4409-011-nowcast-maxele63', '4409-011-nowcast-maxwvel63', '4409-011-nowcast-obs', '4409-011-ofcl-maxele63',
'4409-011-ofcl-swan', '4409-011-ofcl-maxwvel63', '4409-011-ofcl-obs', '4409-012-nowcast-swan', '4409-012-nowcast-maxele63',
'4409-012-nowcast-maxwvel63', '4409-012-nowcast-obs', '4409-012-ofcl-maxele63', '4409-012-ofcl-maxwvel63', '4409-012-ofcl-swan',
'4409-012-ofcl-obs', '4409-003-ofcl-maxele63', '4409-005-nowcast-swan', '4409-005-nowcast-maxele63', '4409-005-nowcast-maxwvel63',
'4409-005-nowcast-obs', '4409-005-ofcl-maxele63', '4409-005-ofcl-swan', '4409-005-ofcl-maxwvel63', '4409-005-ofcl-obs',
'4409-006-nowcast-maxele63', '4409-006-nowcast-swan', '4409-006-nowcast-maxwvel63', '4409-006-nowcast-obs', '4409-004-ofcl-maxele63',
'4409-004-ofcl-swan', '4409-004-ofcl-maxwvel63', '4409-004-ofcl-obs']

for item in psc_runs:
catalog_data: dict = psc_sync.db_info.get_catalog_member_records(run_id=item, limit=limit)

# check the record count
assert 'catalogs' in catalog_data and len(catalog_data['catalogs']) >= 1

# push the data to PSC
assert psc_sync.push_to_psc(catalog_data=catalog_data)

# get the unique keys in the dict
catalogs: list = list(set('-'.join(x['member_def']['id'].split('-')[:-1]) for x in catalog_data))
Expand Down

0 comments on commit 017ca58

Please sign in to comment.