Exemplo n.º 1
0
 def _get_client(self):
     # we ran into races with sharing a ContextClient between threads so
     # now we create a new one for each call. Technically we could probably
     # just have one for create() and one for query() but this is safer
     # in case we start handling multiple provisions simultaneously or
     # something.
     return ContextClient(self._broker_uri, self._key, self._secret)
Exemplo n.º 2
0
 def test_403(self):
     ctx = ContextClient(BROKER_URL, self.key, self.secret + "thismakesitwrong")
     try:
         ctx.get_status(BROKER_URL + str(uuid.uuid4()))
     except BrokerAuthError, e:
         print "got error %s" % e
Exemplo n.º 3
0
 def test_404(self):
     ctx = ContextClient(BROKER_URL, self.key, self.secret)
     try:
         ctx.get_status(BROKER_URL + str(uuid.uuid4()))
     except ContextNotFoundError, e:
         print "got error %s" % e