massive refactoring to switch from camelCase to snake_case:
historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a pre-PEP8 code, to use the same coding style as in Twisted. However, snake_case is more readable and it's better to follow PEP8 best practices, so it has been decided to move on full snake_case. Because Libervia has a huge codebase, this ended with a ugly mix of camelCase and snake_case. To fix that, this patch does a big refactoring by renaming every function and method (including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case. This is a massive change, and may result in some bugs.
This commit is contained in:
parent
d50412c7f7
commit
6a6f15707a
1 changed files with 9945 additions and 9945 deletions
|
|
@ -33,7 +33,7 @@ class XEP_0085Test(helpers.SatTestCase):
|
|||
def setUp(self):
|
||||
self.host = helpers.FakeSAT()
|
||||
self.plugin = plugin.XEP_0085(self.host)
|
||||
self.host.memory.setParam(
|
||||
self.host.memory.param_set(
|
||||
plugin.PARAM_NAME,
|
||||
True,
|
||||
plugin.PARAM_KEY,
|
||||
|
|
@ -41,7 +41,7 @@ class XEP_0085Test(helpers.SatTestCase):
|
|||
Const.PROFILE[0],
|
||||
)
|
||||
|
||||
def test_messageReceived(self):
|
||||
def test_message_received(self):
|
||||
for state in plugin.CHAT_STATES:
|
||||
xml = """
|
||||
<message type="chat" from="%s" to="%s" id="test_1">
|
||||
|
|
@ -56,17 +56,17 @@ class XEP_0085Test(helpers.SatTestCase):
|
|||
plugin.NS_CHAT_STATES,
|
||||
)
|
||||
stanza = parseXml(xml.encode("utf-8"))
|
||||
self.host.bridge.expectCall(
|
||||
"chatStateReceived", Const.JID_STR[1], state, Const.PROFILE[0]
|
||||
self.host.bridge.expect_call(
|
||||
"chat_state_received", Const.JID_STR[1], state, Const.PROFILE[0]
|
||||
)
|
||||
self.plugin.messageReceivedTrigger(
|
||||
self.host.getClient(Const.PROFILE[0]), stanza, None
|
||||
self.plugin.message_received_trigger(
|
||||
self.host.get_client(Const.PROFILE[0]), stanza, None
|
||||
)
|
||||
|
||||
def test_messageSendTrigger(self):
|
||||
def test_message_send_trigger(self):
|
||||
def cb(data):
|
||||
xml = data["xml"].toXml().encode("utf-8")
|
||||
self.assertEqualXML(xml, expected.toXml().encode("utf-8"))
|
||||
self.assert_equal_xml(xml, expected.toXml().encode("utf-8"))
|
||||
|
||||
d_list = []
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ class XEP_0085Test(helpers.SatTestCase):
|
|||
expected.addElement(state, plugin.NS_CHAT_STATES)
|
||||
post_treatments = defer.Deferred()
|
||||
self.plugin.messageSendTrigger(
|
||||
self.host.getClient(Const.PROFILE[0]), mess_data, None, post_treatments
|
||||
self.host.get_client(Const.PROFILE[0]), mess_data, None, post_treatments
|
||||
)
|
||||
|
||||
post_treatments.addCallback(cb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue