MCPcopy Create free account
hub / github.com/explorerhq/sql-explorer / test_avg_duration

Method test_avg_duration

explorer/tests/test_models.py:74–84  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

72 self.assertEqual(q.get_run_count(), expected)
73
74 def test_avg_duration(self):
75 q = SimpleQueryFactory()
76 self.assertIsNone(q.avg_duration())
77 expected = 2.5
78 ql = q.log()
79 ql.duration = 2
80 ql.save()
81 ql = q.log()
82 ql.duration = 3
83 ql.save()
84 self.assertEqual(q.avg_duration(), expected)
85
86 def test_log_saves_duration(self):
87 q = SimpleQueryFactory()

Callers

nothing calls this directly

Calls 4

SimpleQueryFactoryClass · 0.90
avg_durationMethod · 0.80
logMethod · 0.80
saveMethod · 0.80

Tested by

no test coverage detected