Esempio n. 1
0
def newCustomTime(dbConnection, cursor):

  time_now = datetime.now()

  # round down current time
  time_now_rounded = roundTimeDown(time_now)

  # query db for last time recorded
  oldTime = retrieveOldCustomTime(dbConnection, cursor)

  if (time_now_rounded == oldTime): 
    return False
  else: 
    return time_now_rounded
Esempio n. 2
0
def test_roundTimeDown_works_with_0_minute():
    assert roundTimeDown(time_1) == [2020, 6, 1, 10, 0]
Esempio n. 3
0
def test_returns_a_list():
    assert isinstance(roundTimeDown(time_1), list)
Esempio n. 4
0
def test_roundTimeDown_works_with_55_minute():
    assert roundTimeDown(time_4) == [2020, 6, 1, 10, 55]
Esempio n. 5
0
def test_roundTimeDown_works_with_19_minute():
    assert roundTimeDown(time_3) == [2020, 6, 1, 10, 15]