aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorBen Kelly <bk@ancilla.ca>2017-07-12 22:23:26 -0400
committerBen Kelly <btk@google.com>2017-07-12 22:30:24 -0400
commitc9731ec430bb9524d5870b28177bd95279d73362 (patch)
tree93930d4b4d3b40c48738b048c33a983b91466c3c /wee_slack.py
parentb3ea515b1ec6e3192950c1607954f9418527291c (diff)
downloadwee-slack-c9731ec430bb9524d5870b28177bd95279d73362.tar.gz
Fix the tests
Not everything that needed to be mocked out was, and there was also an issue with every instance of PluginConfig sharing the same mutable settings field and thus stomping on each other if you initialized more than one in the same test. Signed-off-by: Ben Kelly <bk@ancilla.ca> Signed-off-by: Ben Kelly <btk@google.com>
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 5fd1648..269904f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3238,7 +3238,7 @@ class PluginConfig(object):
# value is used to set the default for any settings not already defined.
# Following this procedure, the keys remain the same, but the values are
# the real (python) values of the settings.
- settings = {
+ default_settings = {
'background_load_all_history': Setting(
default='false',
desc='Load history for each channel in the background as soon as it'
@@ -3322,11 +3322,12 @@ class PluginConfig(object):
# Set missing settings to their defaults. Load non-missing settings from
# weechat configs.
def __init__(self):
+ self.settings = {}
# Set all descriptions, replace the values in the dict with the
# default setting value rather than the (setting,desc) tuple.
# Use items() rather than iteritems() so we don't need to worry about
# invalidating the iterator.
- for key, (default, desc) in self.settings.items():
+ for key, (default, desc) in self.default_settings.items():
w.config_set_desc_plugin(key, desc)
self.settings[key] = default