def test_public_http_properties_explicit_no_path(self): result = channel_public_http_properties( {'public_http': { 'web_port': 2323 }}) self.assertEqual(result, None)
def test_public_http_properties_explicit_disable(self): result = channel_public_http_properties({ 'public_http': { 'enabled': False, 'web_path': '/foo/bar', 'web_port': 2323 } }) self.assertFalse(result['enabled'])
def test_public_http_properties_explicit_disable(self): result = channel_public_http_properties({ 'public_http': { 'enabled': False, 'web_path': '/foo/bar', 'web_port': 2323 } }) self.assertFalse(result['enabled'])
def test_public_http_properties_implicit(self): result = channel_public_http_properties({ 'web_port': 2323, 'web_path': '/foo/bar' }) self.assertEqual(result, { 'enabled': True, 'web_path': '/foo/bar', 'web_port': 2323 })
def test_public_http_properties_implicit(self): result = channel_public_http_properties({ 'web_port': 2323, 'web_path': '/foo/bar' }) self.assertEqual(result, { 'enabled': True, 'web_path': '/foo/bar', 'web_port': 2323 })
def channel_started(self, channel): properties = channel_public_http_properties(channel._properties) if properties is not None and properties['enabled']: mkpath(self.config.locations_dir) write(self.get_location_path(channel.id), self.get_location_config(properties)) reload_nginx() self.configured_channels.add(channel.id)
def channel_started(self, channel): properties = channel_public_http_properties(channel._properties) if properties is not None and properties['enabled']: mkpath(self.config.locations_dir) write( self.get_location_path(channel.id), self.get_location_config(properties)) reload_nginx() self.configured_channels.add(channel.id)
def test_public_http_properties_explicit_implicit_path(self): result = channel_public_http_properties({ 'config': { 'web_path': '/foo/bar', }, 'public_http': { 'web_port': 2323 }, }) self.assertEqual(result, { 'enabled': True, 'web_path': '/foo/bar', 'web_port': 2323 })
def test_public_http_properties_explicit(self): result = channel_public_http_properties({ 'web_path': '/baz/quux', 'web_port': 2121, 'public_http': { 'web_path': '/foo/bar', 'web_port': 2323, } }) self.assertEqual(result, { 'enabled': True, 'web_path': '/foo/bar', 'web_port': 2323 })
def test_public_http_properties_explicit(self): result = channel_public_http_properties({ 'web_path': '/baz/quux', 'web_port': 2121, 'public_http': { 'web_path': '/foo/bar', 'web_port': 2323, } }) self.assertEqual(result, { 'enabled': True, 'web_path': '/foo/bar', 'web_port': 2323 })
def test_public_http_properties_implicit_no_port(self): result = channel_public_http_properties({'web_path': '/foo/bar'}) self.assertEqual(result, None)
def channel_started(self, channel): log.msg('Channel started: %s, %s from %s' % ( channel.id, channel_public_http_properties(channel._properties), channel._properties)) return super(MessengerPlugin, self).channel_started(channel)
def test_public_http_properties_implicit_no_path(self): result = channel_public_http_properties({'web_port': 2323}) self.assertEqual(result, None)
def test_public_http_properties_implicit_no_port(self): result = channel_public_http_properties({'web_path': '/foo/bar'}) self.assertEqual(result, None)