
from nose.tools import assert_true, assert_equal, assert_false

from desktop.lib.django_test_util import make_logged_in_client


class TestImpala:
  def setUp(self):
    self.client = make_logged_in_client()

  def test_basic_flow(self):
    response = self.client.get("/impala/")
    assert_true("""<li id="impalaIcon"
    class="active""" in response.content, response.content)
    assert_true('Query Editor' in response.content)

    response = self.client.get("/impala/execute/")
    assert_true('Query Editor' in response.content)


import re

from nose.tools import assert_true, assert_equal, assert_false

from desktop.lib.django_test_util import make_logged_in_client


class TestImpala:
  def setUp(self):
    self.client = make_logged_in_client()

  def test_basic_flow(self):
    response = self.client.get("/impala/")
    assert_true(re.search('<li id="impalaIcon"\W+class="active', response.content), response.content)
    assert_true('Query Editor' in response.content)

    response = self.client.get("/impala/execute/")
    assert_true('Query Editor' in response.content)

Fix test looking for Impala icon
[impala] Fix test looking for Impala icon

Use regexp in tests for matching white spaces and new lines

+ 
+ import re
  
  from nose.tools import assert_true, assert_equal, assert_false
  
  from desktop.lib.django_test_util import make_logged_in_client
  
  
  class TestImpala:
    def setUp(self):
      self.client = make_logged_in_client()
  
    def test_basic_flow(self):
      response = self.client.get("/impala/")
+     assert_true(re.search('<li id="impalaIcon"\W+class="active', response.content), response.content)
-     assert_true("""<li id="impalaIcon"
-     class="active""" in response.content, response.content)
      assert_true('Query Editor' in response.content)
  
      response = self.client.get("/impala/execute/")
      assert_true('Query Editor' in response.content)
  
Fix test looking for Impala icon
## Code Before:

from nose.tools import assert_true, assert_equal, assert_false

from desktop.lib.django_test_util import make_logged_in_client


class TestImpala:
  def setUp(self):
    self.client = make_logged_in_client()

  def test_basic_flow(self):
    response = self.client.get("/impala/")
    assert_true("""<li id="impalaIcon"
    class="active""" in response.content, response.content)
    assert_true('Query Editor' in response.content)

    response = self.client.get("/impala/execute/")
    assert_true('Query Editor' in response.content)

## Instruction:
Fix test looking for Impala icon
## Code After:

import re

from nose.tools import assert_true, assert_equal, assert_false

from desktop.lib.django_test_util import make_logged_in_client


class TestImpala:
  def setUp(self):
    self.client = make_logged_in_client()

  def test_basic_flow(self):
    response = self.client.get("/impala/")
    assert_true(re.search('<li id="impalaIcon"\W+class="active', response.content), response.content)
    assert_true('Query Editor' in response.content)

    response = self.client.get("/impala/execute/")
    assert_true('Query Editor' in response.content)
