Example #1
0
    def test_public_http_properties_explicit_no_path(self):
        result = channel_public_http_properties(
            {'public_http': {
                'web_port': 2323
            }})

        self.assertEqual(result, None)
Example #2
0
    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'])
Example #3
0
    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'])
Example #4
0
    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
        })
Example #5
0
    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
        })
Example #6
0
    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)
Example #7
0
    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)
Example #8
0
    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
        })
Example #9
0
    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
        })
Example #10
0
    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
        })
Example #11
0
 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)
Example #13
0
 def test_public_http_properties_implicit_no_path(self):
     result = channel_public_http_properties({'web_port': 2323})
     self.assertEqual(result, None)
Example #14
0
 def test_public_http_properties_implicit_no_port(self):
     result = channel_public_http_properties({'web_path': '/foo/bar'})
     self.assertEqual(result, None)