コード例 #1
0
 def test_stream_count_with_role(self, fixture_db_session,
                                 simple_populated_db):
     """
     Assumes fake packets all belong to one stream.
     """
     roles_insert = set(
         (v.attrib['role'] for v in simple_populated_db.insert_packets))
     q = query.stream_counts_role_breakdown_q(fixture_db_session)
     rb = convenience.to_nested_dict(q.all())
     assert len(rb) == len(simple_populated_db.stream_set)
     n_total_ivorn = 0
     for stream_breakdown in rb.values():
         for role_count in stream_breakdown.values():
             n_total_ivorn += role_count
     assert n_total_ivorn == simple_populated_db.n_inserts
コード例 #2
0
 def test_stream_count_with_role(self, fixture_db_session,
                                 simple_populated_db):
     """
     Assumes fake packets all belong to one stream.
     """
     roles_insert = set(
         (v.attrib['role'] for v in simple_populated_db.insert_packets))
     q = query.stream_counts_role_breakdown_q(fixture_db_session)
     rb = convenience.to_nested_dict(q.all())
     assert len(rb) == len(simple_populated_db.stream_set)
     n_total_ivorn = 0
     for stream_breakdown in rb.values():
         for role_count in stream_breakdown.values():
             n_total_ivorn +=role_count
     assert n_total_ivorn == simple_populated_db.n_inserts
コード例 #3
0
ファイル: views.py プロジェクト: volodymyrss/voeventdb
 def get_query(self):
     return query.stream_counts_role_breakdown_q(db_session)
コード例 #4
0
ファイル: views.py プロジェクト: timstaley/voeventdb
 def get_query(self):
     return query.stream_counts_role_breakdown_q(db_session)