def test_get_last_used(self): storage = CredentialStorage(self.plugin) service_key = create(Builder('service_key')) with freeze(datetime(2018, 1, 10, 15, 30)): create(Builder('access_token').from_key(service_key)) self.assertEqual(datetime(2018, 1, 10, 15, 30), storage.get_last_used(service_key['key_id']))
def get_last_used(self, key_id): storage = CredentialStorage(self.plugin) return storage.get_last_used(key_id)