فهرست منبع

[hive] Update the create table test to check for the result json

Romain Rigaux 10 سال پیش
والد
کامیت
0cc5a9afd9
3فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 3 2
      apps/beeswax/src/beeswax/tests.py
  2. 3 3
      apps/metastore/src/metastore/views.py
  3. 0 1
      desktop/libs/notebook/src/notebook/api.py

+ 3 - 2
apps/beeswax/src/beeswax/tests.py

@@ -1211,8 +1211,9 @@ for x in sys.stdin:
     }, follow=True)
 
     # Ensure we can see table.
-    response = self.client.get("/metastore/table/%s/my_table" % self.db_name)
-    assert_true("my_col" in response.content)
+    response = self.client.get("/metastore/table/%s/my_table?format=json" % self.db_name)
+    data = json.loads(response.content)
+    assert_true("my_col" in [col['name'] for col in data['cols']], data)
 
 
   def test_create_table_timestamp(self):

+ 3 - 3
apps/metastore/src/metastore/views.py

@@ -236,7 +236,7 @@ def describe_table(request, database, table):
         'hdfs_link': table.hdfs_link,
         'comment': table.comment,
         'is_view': table.is_view,
-        'properties': table.properties, 
+        'properties': table.properties,
         'details': table.details,
         'stats': table.stats
     })
@@ -247,7 +247,7 @@ def describe_table(request, database, table):
     if request.REQUEST.get("format", "html") == "json":
       response = {'status': -1, 'error_message': ''}
       error_message = ''
-      table_data = ''      
+      table_data = ''
       try:
         table_data = db.get_sample(database, table)
         response.update({
@@ -258,7 +258,7 @@ def describe_table(request, database, table):
       except Exception, ex:
         error_message, logs = dbms.expand_exception(ex, db)
         response['error_message'] = error_message
-        
+
       return JsonResponse(response)
 
   return render(renderable, request, {

+ 0 - 1
desktop/libs/notebook/src/notebook/api.py

@@ -243,7 +243,6 @@ def historify(request):
   history_doc.save()
   history_doc1.save()
 
-  print history
   if history.get('id'): # If we come from a saved query
     Document2.objects.get(id=history['id']).dependencies.add(history_doc)