예제 #1
0
def test_get_smartstack_endpoints_tcp():
    with mock.patch(
        "service_configuration_lib.read_service_configuration", autospec=True
    ) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {"smartstack": {"tcpone": {"proxy_port": 1234, "mode": "tcp"}}}
        expected = ["tcp://169.254.255.254:1234 (tcpone)"]
        actual = info.get_smartstack_endpoints("unused")
        assert actual == expected
예제 #2
0
def test_get_smartstack_endpoints_http():
    with mock.patch("service_configuration_lib.read_service_configuration",
                    autospec=True) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {
            "smartstack": {
                "main": {
                    "proxy_port": 1234
                }
            }
        }
        expected = ["http://169.254.255.254:1234 (main)"]
        actual = info.get_smartstack_endpoints("unused", "/fake/soa/dir")
        assert actual == expected
예제 #3
0
def test_get_smartstack_endpoints_http():
    with mock.patch('service_configuration_lib.read_service_configuration',
                    autospec=True) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {
            'smartstack': {
                'main': {
                    'proxy_port': 1234
                }
            }
        }
        expected = ["http://169.254.255.254:1234 (main)"]
        actual = info.get_smartstack_endpoints('unused', '/fake/soa/dir')
        assert actual == expected
예제 #4
0
def test_get_smartstack_endpoints_http():
    with mock.patch(
        'service_configuration_lib.read_service_configuration', autospec=True
    ) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {
            'smartstack': {
                'main': {
                    'proxy_port': 1234
                }
            }
        }
        expected = ["http://169.254.255.254:1234 (main)"]
        actual = info.get_smartstack_endpoints('unused', '/fake/soa/dir')
        assert actual == expected
예제 #5
0
def test_get_smartstack_endpoints_tcp():
    with mock.patch('service_configuration_lib.read_service_configuration',
                    autospec=True) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {
            'smartstack': {
                'tcpone': {
                    'proxy_port': 1234,
                    'mode': 'tcp',
                }
            }
        }
        expected = ["tcp://169.254.255.254:1234 (tcpone)"]
        actual = info.get_smartstack_endpoints('unused')
        assert actual == expected
예제 #6
0
def test_get_smartstack_endpoints_tcp():
    with mock.patch(
        'service_configuration_lib.read_service_configuration', autospec=True
    ) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {
            'smartstack': {
                'tcpone': {
                    'proxy_port': 1234,
                    'mode': 'tcp',
                }
            }
        }
        expected = ["tcp://169.254.255.254:1234 (tcpone)"]
        actual = info.get_smartstack_endpoints('unused')
        assert actual == expected