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

 ##########
 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:
   done

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to