Browse Source

HUE-4932 [metadata] Adding several test to list_tags and suggest

Romain Rigaux 9 năm trước cách đây
mục cha
commit
81472af

+ 2 - 2
desktop/libs/metadata/src/metadata/navigator_client.py

@@ -126,9 +126,9 @@ class NavigatorApi(object):
       if facetPrefix is not None:
         body['facetPrefix'] = facetPrefix
       if facetRanges is not None:
-        body['facetRanges'] = query
+        body['facetRanges'] = facetRanges
       if filterQueries is not None:
-        body['filterQueries'] = query
+        body['filterQueries'] = filterQueries
       if firstClassEntitiesOnly is not None:
         body['firstClassEntitiesOnly'] = firstClassEntitiesOnly
 

+ 14 - 0
desktop/libs/metadata/src/metadata/navigator_tests.py

@@ -115,6 +115,20 @@ class TestNavigatorApi(object):
     assert_equal(entity['properties'], json_resp['entity']['properties'])
 
 
+  def test_search_entities_interactive(self):
+    resp = self.client.post(reverse('metadata:list_tags'), self._format_json_body({'prefix': 'hue'}))
+    json_resp = json.loads(resp.content)
+    assert_true('tags' in json_resp)
+    assert_equal(0, json_resp['status'], json_resp)
+
+
+  def test_suggest(self):
+    resp = self.client.post(reverse('metadata:suggest'), self._format_json_body({'prefix': 'hue'}))
+    json_resp = json.loads(resp.content)
+    assert_true('prefix' in json_resp)
+    assert_equal(0, json_resp['status'], json_resp)
+
+
   def test_lineage(self):
     # TODO: write me
     pass