Пример #1
0
def test_init_missing_cert():
    """ Try to initialize the context with a nonexistant cert. """
    config = load_config()
    config['name'] = "failboat"
    config['sign_messages'] = True
    context = FedMsgContext(**config)
    context.publish(topic='awesome', msg=dict(foo='bar'))
Пример #2
0
    def setUp(self):
        config = load_config()
        self.hub = CentralMokshaHub(config=config)
        self.context = FedMsgContext(**config)

        # fully qualified
        self.fq_topic = "org.fedoraproject.dev.unittest.foo"
        # short version
        self.topic = "foo"
Пример #3
0
    def setUp(self):
        config = load_config()
        self.hub = CentralMokshaHub(config=config)
        self.context = FedMsgContext(**config)

        # fully qualified
        self.fq_topic = "com.test_prefix.dev.%s.foo" % unittest.__name__
        # short version
        self.topic = "foo"
Пример #4
0
#   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
#   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
#   OTHER DEALINGS IN THE SOFTWARE.
"""
Setup a fedmsg context suitable for Debexpo.
"""

__author__ = 'Simon Chopin'
__copyright__ = 'Copyright © 2013 Simon Chopin'
__license__ = 'MIT'

from fedmsg.core import FedMsgContext
from fedmsg.config import load_config
from threading import Lock
import pylons

# We use the fedmsg configuration from /etc/fedmsg.d/
fedmsg_config = load_config([], None)

fedmsg_config['name'] = pylons.config["debexpo.fedmsg_endpoint_name"]

__context = FedMsgContext(**fedmsg_config)
__context_lock = Lock()


def publish(**kw):
    __context_lock.acquire()
    __context.publish(**kw)
    __context_lock.release()
Пример #5
0
def test_init_missing_endpoint():
    """ Try to initialize the context with a nonexistant service name. """
    config = load_config()
    config['name'] = "failboat"
    config['sign_messages'] = True
    context = FedMsgContext(**config)
Пример #6
0
 def setUp(self):
     config = load_config()
     config['io_threads'] = 1
     self.ctx = FedMsgContext(**config)