Ejemplo n.º 1
0
 def test_init(self):
     link1 = Link(primary_user='******', generated_key='%key1', provided_key='key2', expired=True, expires='29/02/1968')
     self.assertIsNotNone(link1)
     self.assertEqual("<Linked(id='n/a', primary_user='******', generated_key='%key1', provided_key='key2', expired='True', expires='29/02/1968')>", str(link1))
     
     link2 = Link(id=1, primary_user='******', generated_key='%key1', provided_key='key2', expired=True, expires='29/02/1968')
     self.assertIsNotNone(link2)
     self.assertEqual("<Linked(id='1', primary_user='******', generated_key='%key1', provided_key='key2', expired='True', expires='29/02/1968')>", str(link2))
Ejemplo n.º 2
0
 def create_link(self,
                 primary_userid,
                 provided_key,
                 generated_key,
                 expires,
                 expired=False,
                 retry_count=0):
     link = Link(primary_user=primary_userid,
                 generated_key=generated_key,
                 provided_key=provided_key,
                 expires=expires,
                 expired=expired,
                 retry_count=retry_count)
     self._storage_engine.session.add(link)
     return link
Ejemplo n.º 3
0
 def create_link(self, primary_userid, generated_key, provided_key):
     link = Link(primary_user=primary_userid,
                 generated_key=generated_key,
                 provided_key=provided_key)
     self._storage_engine.session.add(link)
     return link
Ejemplo n.º 4
0
 def patch_get_link(self, userid):
     link = Link()
     link.expired = True
     return link