Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved sqllab tests from core_tests to sqllab_tests #1502

Merged
merged 4 commits into from
Nov 2, 2016

Conversation

vera-liu
Copy link
Contributor

@vera-liu vera-liu commented Nov 1, 2016

Why:

  • Since sql lab is a separate page, separating its endpoint tests to a separate file would make our tests cleaner and easier to add new tests

Done:

  • moved run_sql() to base_tests since it's used by both core_tests and sqllab_tests
  • moved sql lab related tests to sqllab_tests.py

needs-review @mistercrunch @bkyryliuk

@@ -176,3 +176,14 @@ def revoke_public_access(self, table_name):
if (perm.permission.name == 'datasource_access' and
perm.view_menu and table_name in perm.view_menu.name):
appbuilder.sm.del_permission_role(public_role, perm)

def run_sql(self, sql, user_name, client_id):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make user_name optional and if none run as admin

self.run_sql("SELECT * FROM ab_permission", 'gamma', client_id='client_id_2')

def tearDown(self):
pass
Copy link
Member

@bkyryliuk bkyryliuk Nov 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db.session.query(models.Query).delete()
do the same in core tests


def test_sql_json(self):
data = self.run_sql('SELECT * FROM ab_user', 'admin', "1")
assert len(data['data']) > 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you are here, could you please refactor asserts into assertEquals, assertLess, etc ?

@bkyryliuk
Copy link
Member

minor comments, looks good overall !

@vera-liu vera-liu merged commit a13bed2 into apache:master Nov 2, 2016
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants