Example #1
0
    def test_deploy_k8s_bar(self):
        deploy_config = DeployConfig('k8s', 'bar', 'organization.tld')

        self.assertEqual(deploy_config.location(), 'k8s')
        self.assertEqual(deploy_config.service_ns('quam'), 'bar')
        self.assertEqual(deploy_config.service_ns('foo'), 'bar')
        self.assertEqual(deploy_config.scheme(), 'https')
        self.assertEqual(deploy_config.auth_session_cookie_name(), 'sesh')

        self.assertEqual(deploy_config.base_path('foo'), '/bar/foo')
        self.assertEqual(deploy_config.base_url('foo'), 'https://foo.bar/bar/foo')
        self.assertEqual(deploy_config.url('foo', '/moo'), 'https://foo.bar/bar/foo/moo')
        self.assertEqual(deploy_config.external_url('foo', '/moo'), 'https://internal.organization.tld/bar/foo/moo')
Example #2
0
    def test_deploy_external_default(self):
        deploy_config = DeployConfig('external', 'default', {'foo': 'bar'})

        self.assertEqual(deploy_config.location(), 'external')
        self.assertEqual(deploy_config.service_ns('quam'), 'default')
        self.assertEqual(deploy_config.service_ns('foo'), 'bar')
        self.assertEqual(deploy_config.scheme(), 'https')
        self.assertEqual(deploy_config.auth_session_cookie_name(), 'session')

        self.assertEqual(deploy_config.domain('quam'), 'quam.hail.is')
        self.assertEqual(deploy_config.base_path('quam'), '')
        self.assertEqual(deploy_config.base_url('quam'),
                         'https://quam.hail.is')
        self.assertEqual(deploy_config.url('quam', '/moo'),
                         'https://quam.hail.is/moo')
        self.assertEqual(deploy_config.external_url('quam', '/moo'),
                         'https://quam.hail.is/moo')

        self.assertEqual(deploy_config.base_path('foo'), '/bar/foo')
        self.assertEqual(deploy_config.base_url('foo'),
                         'https://internal.hail.is/bar/foo')
        self.assertEqual(deploy_config.url('foo', '/moo'),
                         'https://internal.hail.is/bar/foo/moo')
        self.assertEqual(deploy_config.external_url('foo', '/moo'),
                         'https://internal.hail.is/bar/foo/moo')
Example #3
0
    def test_deploy_external_default(self):
        deploy_config = DeployConfig('external', 'default', 'organization.tld')

        self.assertEqual(deploy_config.location(), 'external')
        self.assertEqual(deploy_config.service_ns('quam'), 'default')
        self.assertEqual(deploy_config.service_ns('foo'), 'default')
        self.assertEqual(deploy_config.scheme(), 'https')
        self.assertEqual(deploy_config.auth_session_cookie_name(), 'session')

        self.assertEqual(deploy_config.domain('quam'), 'quam.organization.tld')
        self.assertEqual(deploy_config.base_path('quam'), '')
        self.assertEqual(deploy_config.base_url('quam'), 'https://quam.organization.tld')
        self.assertEqual(deploy_config.url('quam', '/moo'), 'https://quam.organization.tld/moo')
        self.assertEqual(deploy_config.external_url('quam', '/moo'), 'https://quam.organization.tld/moo')