示例#1
0
def test_submit_topology(configs):
    mock_storm_cluster = mock.Mock()

    with mock.patch.object(pyleus.cli.topologies, 'StormCluster',
            return_value=mock_storm_cluster) as mock_ctr:
        submit_topology(mock.sentinel.jar_path, configs)

    mock_ctr.assert_called_once_with(
        configs.storm_cmd_path,
        configs.nimbus_host,
        configs.nimbus_port,
        configs.verbose,
        configs.jvm_opts,
    )

    mock_storm_cluster.submit.assert_called_once_with(mock.sentinel.jar_path)
示例#2
0
 def run_topology(self, jar_path, configs):
     submit_topology(jar_path, configs)