Skip to content

Commit

Permalink
more testing work...
Browse files Browse the repository at this point in the history
rref #5367
rref #5366

ref #66
ref #65
  • Loading branch information
evrenesat committed Jul 25, 2016
1 parent 084c836 commit 114a8d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions tests/async_amqp/messaging_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@


class TestCase(ConcurrentTestCase):
def __init__(self, *args, **kwargs):
super(TestCase, self).__init__(*args, **kwargs)

def test_channel_list(self):
self.post('ulakbus', dict(view="_zops_list_channels"), self.show_channel)

Expand All @@ -23,16 +26,19 @@ def show_channel(self, res, req):
dict(view="_zops_show_channel", channel_key=ch_key),
self.create_message)


def create_message(self, res, req):
self.post('ulakbus',
{"view": "_zops_create_message",
"message": dict(
body='test_body', title='testtitle',
channel=res['channel_key'],
receiver='',
type=2
)})
"message": dict(
body='test_body', title='testtitle',
channel=res['key'],
receiver='',
type=2
)})

def cmd_user_status(self, res, req):
print("CMD: user_status:")
print(res)

def cmd_message(self, res, req=None):
print("MESSAGE RECEIVED")
Expand Down
4 changes: 2 additions & 2 deletions zengine/lib/concurrent_amqp_test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def backend_to_client(self, body):
self.message_stack[body['callbackID']] = body
self.message_callbacks[body['callbackID']](body)
elif 'cmd' in body:
self.message_callbacks[body['cmd']](body)
self.cmds[body['cmd']](body)
except:
import traceback
print("\n")
Expand Down Expand Up @@ -136,11 +136,11 @@ class ConcurrentTestCase(object):

def __init__(self, queue_manager):
log.info("ConcurrentTestCase class init with %s" % queue_manager)
self.cmds = {}
self.queue_manager = queue_manager
self.clients = {}
self.make_client('ulakbus')
self.run_tests()
self.cmds = {}
self.register_cmds()

def make_client(self, username):
Expand Down

0 comments on commit 114a8d6

Please sign in to comment.