summaryrefslogtreecommitdiff
path: root/service/test/unit/config
diff options
context:
space:
mode:
authorBruno Wagner <bwgpro@gmail.com>2015-06-03 17:10:08 -0300
committerBruno Wagner <bwgpro@gmail.com>2015-06-03 17:10:08 -0300
commitf4f2f0ff3e808bc2c85b914aa750ad68770ed334 (patch)
tree1163a23d6914fc6da2efddbf1f936144c1435a9f /service/test/unit/config
parentff3563cbd29cb4f2977ff476389ba679324dac5a (diff)
Creating a leap session is now part of leap init
We've moved the init soledad method to the leap_initialization module and gave it a meaningful name, because it was initializing the whole leap session instead of only soledad, because of that we removed some of the uneeded config files and deduplicated some code on maintenance to use the same facilities. Some arguments had non-meaningful variable names and args was being passed everywhere (it was unclear who was using which variables in the args) We changed the initialization to pass those arguments explicitly, then we can factor them out sometime when it makes sense
Diffstat (limited to 'service/test/unit/config')
-rw-r--r--service/test/unit/config/test_app_factory.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/service/test/unit/config/test_app_factory.py b/service/test/unit/config/test_app_factory.py
index b09ffd4c..8a89d6e6 100644
--- a/service/test/unit/config/test_app_factory.py
+++ b/service/test/unit/config/test_app_factory.py
@@ -20,8 +20,9 @@ class AppFactoryTest(unittest.TestCase):
def test_that_create_app_binds_to_tcp_port_if_no_ssl_options(self, reactor_mock, init_app_mock):
app_mock = MagicMock()
leap_session = MagicMock()
+ config = AppFactoryTest.MockConfig(12345, '127.0.0.1', leap_session)
- create_app(app_mock, AppFactoryTest.MockConfig(12345, '127.0.0.1'), leap_session)
+ create_app(config.home, leap_session, config.host, config.port, config.sslkey, config.sslcert)
reactor_mock.listenTCP.assert_called_once_with(12345, ANY, interface='127.0.0.1')
@@ -30,8 +31,10 @@ class AppFactoryTest(unittest.TestCase):
def test_that_create_app_binds_to_ssl_if_ssl_options(self, reactor_mock, init_app_mock):
app_mock = MagicMock()
leap_session = MagicMock()
- pixelated.config.app_factory._ssl_options = lambda _: 'options'
+ pixelated.config.app_factory._ssl_options = lambda x, y: 'options'
- create_app(app_mock, AppFactoryTest.MockConfig(12345, '127.0.0.1', sslkey="sslkey", sslcert="sslcert"), leap_session)
+ config = AppFactoryTest.MockConfig(12345, '127.0.0.1', sslkey="sslkey", sslcert="sslcert")
+
+ create_app(config.home, leap_session, config.host, config.port, config.sslkey, config.sslcert)
reactor_mock.listenSSL.assert_called_once_with(12345, ANY, 'options', interface='127.0.0.1')