示例#1
0
def run():
    loader = Loader()
    loader.load()
    # AMQP-0-9-1
    adapter = loader.catalog['amqp-0-9-1']
    test = Test(URL, adapter)
    test()
    # amqp
    adapter = loader.catalog['amqp']
    test = Test(URL, adapter)
    test()
示例#2
0
文件: test_amqp.py 项目: jortel/gofer
def run():
    loader = Loader()
    loader.load()
    # AMQP-0-9-1
    adapter = loader.catalog['amqp-0-9-1']
    test = Test(URL, adapter)
    test()
    # amqp
    adapter = loader.catalog['amqp']
    test = Test(URL, adapter)
    test()
示例#3
0
def run():
    loader = Loader()
    loader.load()
    # amqp-1-0
    adapter = loader.catalog['amqp-1-0']
    test = Test(URL, adapter)
    test.test_crud()
    test.test_no_exchange()
    # proton
    adapter = loader.catalog['proton']
    test = Test(URL, adapter)
    test.test_crud()
    test.test_no_exchange()
示例#4
0
def run():
    loader = Loader()
    loader.load()
    # amqp-1-0
    adapter = loader.catalog['amqp-1-0']
    test = Test(URL, adapter)
    test.test_crud()
    test.test_no_exchange()
    # proton
    adapter = loader.catalog['proton']
    test = Test(URL, adapter)
    test.test_crud()
    test.test_no_exchange()
示例#5
0
def run():
    # AMQP-0-10
    loader = Loader()
    loader.load()
    adapter = loader.catalog['amqp-0-10']
    test = Test(URL, adapter)
    test()
    # qpid
    adapter = loader.catalog['qpid']
    test = Test(URL, adapter)
    test()
    # qpid-messaging
    adapter = loader.catalog['qpid.messaging']
    test = Test(URL, adapter)
    test()
示例#6
0
def run():
    # AMQP-0-10
    loader = Loader()
    loader.load()
    adapter = loader.catalog['amqp-0-10']
    test = Test(URL, adapter)
    test()
    # qpid
    adapter = loader.catalog['qpid']
    test = Test(URL, adapter)
    test()
    # qpid-messaging
    adapter = loader.catalog['qpid.messaging']
    test = Test(URL, adapter)
    test()
示例#7
0
 def test_already_loaded(self, _load):
     ldr = Loader()
     ldr.list = [1, 2]
     ldr.catalog = {'A': 1, 'B': 2}
     _list, catalog = ldr.load()
     self.assertFalse(_load.called)
     self.assertEqual(_list, ldr.list)
     self.assertEqual(catalog, ldr.catalog)
示例#8
0
 def test_already_loaded(self, _load):
     ldr = Loader()
     ldr.list = [1, 2]
     ldr.catalog = {'A': 1, 'B': 2}
     _list, catalog = ldr.load()
     self.assertFalse(_load.called)
     self.assertEqual(_list, ldr.list)
     self.assertEqual(catalog, ldr.catalog)
示例#9
0
 def test_load(self, _load):
     _load.return_value = ([], {})
     ldr = Loader()
     _list, catalog = ldr.load()
     _load.assert_called_with()
     self.assertEqual(_list, _load.return_value[0])
     self.assertEqual(catalog, _load.return_value[1])
     self.assertEqual(ldr.list, _load.return_value[0])
     self.assertEqual(ldr.catalog, _load.return_value[1])
示例#10
0
 def test_load(self, _load):
     _load.return_value = ([], {})
     ldr = Loader()
     _list, catalog = ldr.load()
     _load.assert_called_with()
     self.assertEqual(_list, _load.return_value[0])
     self.assertEqual(catalog, _load.return_value[1])
     self.assertEqual(ldr.list, _load.return_value[0])
     self.assertEqual(ldr.catalog, _load.return_value[1])