def test_clean_simulate():
    mock_zk = create_mock_zk()
    assert clean_nerve.clean(simulate=True, zk=mock_zk) == 1
    mock_zk.delete.assert_has_calls([])
def test_clean():
    mock_zk = create_mock_zk()
    assert clean_nerve.clean(simulate=False, zk=mock_zk) == 1
    expected_calls = [mock.call('/nerve/region:alpha/foo/orphaned_service_node')]
    mock_zk.delete.assert_has_calls(expected_calls)