Beispiel #1
0
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())
Beispiel #2
0
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())
Beispiel #3
0
def test__GgoQuery__has_gsrn__Ggo_does_not_exist__returs_nothing(seeded_session, gsrn):
    query = GgoQuery(seeded_session) \
        .has_gsrn(gsrn)

    assert query.count() == 0
    assert query.one_or_none() is None
Beispiel #4
0
def test__GgoQuery__begins_within__Ggo_does_not_exist__returs_nothing(seeded_session, begin, end):
    query = GgoQuery(seeded_session) \
        .begins_within(DateTimeRange(begin=begin, end=end))

    assert query.count() == 0
Beispiel #5
0
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())
Beispiel #6
0
def test__GgoQuery__begins_at__Ggo_does_not_exist__returs_nothing(seeded_session, ggo_begin):
    query = GgoQuery(seeded_session) \
        .begins_at(ggo_begin)

    assert query.count() == 0
Beispiel #7
0
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())
Beispiel #8
0
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())