Skip to content

Commit

Permalink
fix: fix the data_generator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlukasse committed Jan 23, 2024
1 parent 9ac8935 commit 80108b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/data_generator/datagenerator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,26 @@ func TestRunDataGeneration(t *testing.T) {
if countCohorts != 5 {
t.Errorf("Expected 5 cohort_definition records, found %d", countCohorts)
}
}

func TestRunDataGeneration2(t *testing.T) {
// second part of the test...added here to avoid running in parallel with part above:
tearDown()
setUp(t)

RunDataGeneration("example_test_data_config")

countCohorts := tests.GetCount(db.GetAtlasDB(), "cohort_definition")
countCohorts = tests.GetCount(db.GetAtlasDB(), "cohort_definition")
if countCohorts != 3 {
t.Errorf("Expected 3 cohort_definition records, found %d", countCohorts)
}
countPersons := tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "person")
countPersons = tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "person")
if countPersons != 36 {
t.Errorf("Expected 36 persons, found %d", countPersons)
}
countObservations := tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "observation")
countObservations = tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "observation")
if countObservations != 60 {
t.Errorf("Expected 60 observations, found %d", countObservations)
}
countConcepts := tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "concept")
countConcepts = tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "concept")
if countConcepts != 11 {
t.Errorf("Expected 11 concepts, found %d", countConcepts)
}
Expand Down

0 comments on commit 80108b6

Please sign in to comment.