コード例 #1
0
ファイル: test_utils.py プロジェクト: todun/junebug
    def test_public_http_properties_explicit_no_path(self):
        result = channel_public_http_properties(
            {'public_http': {
                'web_port': 2323
            }})

        self.assertEqual(result, None)
コード例 #2
0
ファイル: test_utils.py プロジェクト: todun/junebug
    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'])
コード例 #3
0
ファイル: test_utils.py プロジェクト: BantouTelecom/junebug
    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'])
コード例 #4
0
ファイル: test_utils.py プロジェクト: grigi/junebug
    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
        })
コード例 #5
0
ファイル: test_utils.py プロジェクト: BantouTelecom/junebug
    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
        })
コード例 #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)
コード例 #7
0
ファイル: plugin.py プロジェクト: praekelt/junebug
    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)
コード例 #8
0
ファイル: test_utils.py プロジェクト: todun/junebug
    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
        })
コード例 #9
0
ファイル: test_utils.py プロジェクト: grigi/junebug
    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
        })
コード例 #10
0
ファイル: test_utils.py プロジェクト: BantouTelecom/junebug
    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
        })
コード例 #11
0
ファイル: test_utils.py プロジェクト: todun/junebug
 def test_public_http_properties_implicit_no_port(self):
     result = channel_public_http_properties({'web_path': '/foo/bar'})
     self.assertEqual(result, None)
コード例 #12
0
 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)
コード例 #13
0
ファイル: test_utils.py プロジェクト: BantouTelecom/junebug
 def test_public_http_properties_implicit_no_path(self):
     result = channel_public_http_properties({'web_port': 2323})
     self.assertEqual(result, None)
コード例 #14
0
ファイル: test_utils.py プロジェクト: BantouTelecom/junebug
 def test_public_http_properties_implicit_no_port(self):
     result = channel_public_http_properties({'web_path': '/foo/bar'})
     self.assertEqual(result, None)