def test_callback_server_params(params):
    """
    Test that the callback server parameters can be given as both a CallbackServerParameters
    instance or a dict.

    """
    params = Py4JComponent.configure_gateway('default', callback_server=params)[-3]
    assert params.address == '1.2.3.4'
    assert params.port == 5678
def test_classpath_pkgname_substitution():
    """
    Test that package names in the class path are substituted with the corresponding absolute
    directory paths.

    """
    import asphalt.py4j
    classpath = Py4JComponent.configure_gateway('default',
                                                classpath='{asphalt.py4j}/javadir/*')[-2]
    assert classpath == '%s/javadir/*' % os.path.dirname(asphalt.py4j.__file__)
    assert classpath.endswith(os.path.join('asphalt', 'py4j', 'javadir', '*'))