def test_rfc3339_time():
    """
    Verify the format returned from rfc3339_time
    """
    t = cmdlib.rfc3339_time()
    assert datetime.datetime.strptime(t, '%Y-%m-%dT%H:%M:%SZ')
    # now and utcnow don't set TZ's. We should get a raise
    with pytest.raises(AssertionError):
        cmdlib.rfc3339_time(datetime.datetime.now())
Пример #2
0
 def bump_timestamp(self):
     self._data['timestamp'] = rfc3339_time()
     self.flush()