Commit af91bbf6 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2922] Minor: Consistency in group names and quotes

parent 779d5913
......@@ -289,7 +289,7 @@ class MsgqRunTest(unittest.TestCase):
"""
conn = self.__get_connection()
# Activate the session, pretend to be the config manager.
conn.group_subscribe("ConfigManager")
conn.group_subscribe('ConfigManager')
# Answer request for logging config
(msg, env) = conn.group_recvmsg(nonblock=False)
self.assertEqual({'command': ['get_config',
......@@ -321,7 +321,7 @@ class MsgqRunTest(unittest.TestCase):
attempts -= 1
self.assertTrue(synchronised)
# The actual test
conn.group_subscribe("notifications/cc_members")
conn.group_subscribe('notifications/cc_members')
(msg, env) = conn.group_recvmsg(nonblock=False)
self.assertEqual({'notification': ['subscribed', {
'client': conn.lname,
......
......@@ -199,19 +199,19 @@ class MsgQTest(unittest.TestCase):
class Sock:
def __init__(self, fileno):
self.fileno = lambda: fileno
self.__msgq.lnames["first"] = Sock(1)
self.__msgq.lnames["second"] = Sock(2)
self.__msgq.fd_to_lname[1] = "first"
self.__msgq.fd_to_lname[2] = "second"
self.__msgq.lnames['first'] = Sock(1)
self.__msgq.lnames['second'] = Sock(2)
self.__msgq.fd_to_lname[1] = 'first'
self.__msgq.fd_to_lname[2] = 'second'
# Subscribe them to some groups
self.__msgq.process_command_subscribe(self.__msgq.lnames["first"],
{'group': "G1", 'instance': "*"},
self.__msgq.process_command_subscribe(self.__msgq.lnames['first'],
{'group': 'G1', 'instance': '*'},
None)
self.__msgq.process_command_subscribe(self.__msgq.lnames["second"],
{'group': "G1", 'instance': "*"},
self.__msgq.process_command_subscribe(self.__msgq.lnames['second'],
{'group': 'G1', 'instance': '*'},
None)
self.__msgq.process_command_subscribe(self.__msgq.lnames["second"],
{'group': "G2", 'instance': "*"},
self.__msgq.process_command_subscribe(self.__msgq.lnames['second'],
{'group': 'G2', 'instance': '*'},
None)
# Now query content of some groups through the command handler.
self.__msgq.running = True # Enable the command handler
......@@ -228,16 +228,16 @@ class MsgQTest(unittest.TestCase):
# on them)
json.dumps(result)
# Members of the G1 and G2
self.assertEqual({'result': [0, ["second"]]},
self.assertEqual({'result': [0, ['second']]},
self.__msgq.command_handler('members',
{'group': "G2"}))
{'group': 'G2'}))
check_both(self.__msgq.command_handler('members', {'group': 'G1'}))
# We pretend that all the possible groups exist, just that most
# of them are empty. So requesting for G3 is request for an empty
# of them are empty. So requesting for Empty is request for an empty
# group and should not fail.
self.assertEqual({'result': [0, []]},
self.__msgq.command_handler('members',
{'group': "Empty"}))
{'group': 'Empty'}))
# Without the name of the group, we just get all the clients.
check_both(self.__msgq.command_handler('members', {}))
# Omitting the parameters completely in such case is OK
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment