You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/01/30 17:14:15 UTC

[GitHub] [incubator-superset] willbarrett commented on a change in pull request #9054: [database] new, select star API migration

willbarrett commented on a change in pull request #9054: [database] new, select star API migration
URL: https://github.com/apache/incubator-superset/pull/9054#discussion_r373080970
 
 

 ##########
 File path: tests/database_api_tests.py
 ##########
 @@ -140,3 +140,34 @@ def test_get_table_metadata_no_db_permission(self):
         uri = f"api/v1/database/{example_db.id}/birth_names/null/"
         rv = self.client.get(uri)
         self.assertEqual(rv.status_code, 404)
+
+    def test_get_select_star(self):
+        """
+            Database API: Test get select star
+        """
+        self.login(username="admin")
+        example_db = get_example_database()
+        uri = f"api/v1/database/{example_db.id}/select_star/birth_names/"
+        rv = self.client.get(uri)
+        self.assertEqual(rv.status_code, 200)
+        response = json.loads(rv.data.decode("utf-8"))
+        self.assertIn("gender", response["result"])
+
+    def test_get_select_star_not_allowed(self):
+        """
+            Database API: Test get select star not allowed
+        """
+        self.login(username="gamma")
+        example_db = get_example_database()
+        uri = f"api/v1/database/{example_db.id}/select_star/birth_names/"
+        rv = self.client.get(uri)
+        self.assertEqual(rv.status_code, 404)
+
+    def test_get_select_star_not_found(self):
+        """
+            Database API: Test get select star not found
+        """
+        self.login(username="admin")
+        uri = f"api/v1/database/1000/select_star/birth_names/"
 
 Review comment:
   To avoid possible flakiness, I'd recommend getting the last primary key for databases and adding 1 - a fixed primary key can result in failures when the primary keys of created resources drift upwards over time..

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org