Ejemplo n.º 1
0
  def test_daily(self):
    leaderboard = Leaderboard(horizon="daily", metric="bar", interval="baz")

    date = leaderboard.start_date()
    now = datetime.datetime.now(datetime.timezone.utc)

    self.assertEqual(now.day, date.day)
    self.assertEqual(0, date.hour)
    self.assertEqual(0, date.minute)
Ejemplo n.º 2
0
  def test_all(self):
    leaderboard = Leaderboard(horizon="all", metric="bar", interval="baz")

    self.assertIsNone(leaderboard.start_date())
Ejemplo n.º 3
0
  def test_bogus(self):
    leaderboard = Leaderboard(horizon="foo", metric="bar", interval="foo")

    self.assertIsNone(leaderboard.start_date())