소스 검색

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

Romain Rigaux 9 년 전
부모
커밋
81472af246
2개의 변경된 파일16개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      desktop/libs/metadata/src/metadata/navigator_client.py
  2. 14 0
      desktop/libs/metadata/src/metadata/navigator_tests.py

+ 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