phase8: expand test coverage and refine docs with gitflow milestones
This commit is contained in:
@ -26,6 +26,47 @@ def test_run_full_sync_creates_domain_objects(settings):
|
||||
assert PlayerSeasonStats.objects.count() >= 1
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_full_sync_is_idempotent(settings):
|
||||
settings.PROVIDER_DEFAULT_NAMESPACE = "mvp_demo"
|
||||
|
||||
run_sync_job(provider_namespace="mvp_demo", job_type=IngestionRun.JobType.FULL_SYNC)
|
||||
counts_after_first = {
|
||||
"competition": Competition.objects.count(),
|
||||
"team": Team.objects.count(),
|
||||
"season": Season.objects.count(),
|
||||
"player": Player.objects.count(),
|
||||
"player_season": PlayerSeason.objects.count(),
|
||||
"player_stats": PlayerSeasonStats.objects.count(),
|
||||
}
|
||||
|
||||
run_sync_job(provider_namespace="mvp_demo", job_type=IngestionRun.JobType.FULL_SYNC)
|
||||
counts_after_second = {
|
||||
"competition": Competition.objects.count(),
|
||||
"team": Team.objects.count(),
|
||||
"season": Season.objects.count(),
|
||||
"player": Player.objects.count(),
|
||||
"player_season": PlayerSeason.objects.count(),
|
||||
"player_stats": PlayerSeasonStats.objects.count(),
|
||||
}
|
||||
|
||||
assert counts_after_first == counts_after_second
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_incremental_sync_runs_successfully(settings):
|
||||
settings.PROVIDER_DEFAULT_NAMESPACE = "mvp_demo"
|
||||
|
||||
run = run_sync_job(
|
||||
provider_namespace="mvp_demo",
|
||||
job_type=IngestionRun.JobType.INCREMENTAL,
|
||||
cursor="demo-cursor",
|
||||
)
|
||||
|
||||
assert run.status == IngestionRun.RunStatus.SUCCESS
|
||||
assert run.records_processed > 0
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_run_sync_handles_rate_limit(settings):
|
||||
settings.PROVIDER_DEFAULT_NAMESPACE = "mvp_demo"
|
||||
|
||||
Reference in New Issue
Block a user