def test__GgoQuery__is_published__returns_correct_ggos(seeded_session, published): query = GgoQuery(seeded_session) \ .is_published(published) assert query.count() > 0 assert all(ggo.measurement.published == published for ggo in query.all())
def test__GgoQuery__has_gsrn__Ggo_exists__returns_correct_ggos(seeded_session, gsrn): query = GgoQuery(seeded_session) \ .has_gsrn(gsrn) assert query.count() > 0 assert all(ggo.gsrn == gsrn for ggo in query.all())
def test__GgoQuery__begins_at__returns_correct_ggos(seeded_session, ggo_begin): query = GgoQuery(seeded_session) \ .begins_at(ggo_begin) assert query.count() > 0 assert all(ggo.begin == ggo_begin for ggo in query.all())
def test__GgoQuery__begins_within__returns_correct_ggos(seeded_session, begin, end): query = GgoQuery(seeded_session) \ .begins_within(DateTimeRange(begin=begin, end=end)) assert query.count() > 0 assert all(begin <= ggo.begin <= end for ggo in query.all())
def test__GgoQuery__belongs_to__returns_correct_ggos(seeded_session, sub): query = GgoQuery(seeded_session) \ .belongs_to(sub) assert query.count() > 0 assert all(ggo.measurement.sub == sub for ggo in query.all())