示例#1
0
文件: tests.py 项目: jessica9421/hue
def _make_query(client,
                query,
                submission_type="Execute",
                udfs=None,
                settings=None,
                resources=[],
                wait=False,
                name=None,
                desc=None,
                local=True,
                is_parameterized=True,
                max=30.0,
                database='default',
                email_notify=False,
                **kwargs):
    """Wrapper around the real make_query"""
    res = make_query(client, query, submission_type, udfs, settings, resources,
                     wait, name, desc, local, is_parameterized, max, database,
                     email_notify, **kwargs)

    # Should be in the history if it's submitted.
    if submission_type == 'Execute':
        fragment = collapse_whitespace(smart_str(query[:20]))
        verify_history(client, fragment=fragment)

    return res
示例#2
0
文件: tests.py 项目: anutron/hue
def _make_query(client, query, submission_type="Execute",
                follow=True, udfs=None, settings=None, resources=[],
                wait=False, name=None, desc=None, local=True,
                is_parameterized=True):
  """Wrapper around the real make_query"""
  res = make_query(client, query, submission_type,
                   follow, udfs, settings, resources,
                   wait, name, desc, local, is_parameterized)
  # Should be in the history if it's submitted.
  if submission_type == 'Execute':
    verify_history(client, fragment=collapse_whitespace(query[:20]))

  return res
示例#3
0
文件: tests.py 项目: voyageth/hue
def _make_query(client, query, submission_type="Execute",
                udfs=None, settings=None, resources=[],
                wait=False, name=None, desc=None, local=True,
                is_parameterized=True, max=30.0, database='default', email_notify=False, **kwargs):
  """Wrapper around the real make_query"""
  res = make_query(client, query, submission_type,
                   udfs, settings, resources,
                   wait, name, desc, local, is_parameterized, max, database, email_notify, **kwargs)

  # Should be in the history if it's submitted.
  if submission_type == 'Execute':
    fragment = collapse_whitespace(smart_str(query[:20]))
    verify_history(client, fragment=fragment)

  return res
示例#4
0
文件: tests.py 项目: gigfork/hue
def test_collapse_whitespace():
  assert_equal("", collapse_whitespace("\t\n\n  \n\t \n"))
  assert_equal("x", collapse_whitespace("\t\nx\n  \n\t \n"))
  assert_equal("x y", collapse_whitespace("\t\nx\n  \ny\t \n"))
示例#5
0
def test_collapse_whitespace():
    assert_equal("", collapse_whitespace("\t\n\n  \n\t \n"))
    assert_equal("x", collapse_whitespace("\t\nx\n  \n\t \n"))
    assert_equal("x y", collapse_whitespace("\t\nx\n  \ny\t \n"))