HUE-8737 [core] Fix desktop tests for py3

Review Request #14649 — Created Dec. 20, 2019 and updated

yingc
hue
master
HUE-8737
jgauthier, johan, ranade, romain, weixia
commit 1c6ed64dc3c49babfe911fc9f86c6b611b67e708 (HEAD -> py3_unittest)
Author: Ying Chen <yingchen@cloudera.com>
Date:   Thu Dec 12 13:47:10 2019 -0800

    HUE-8737 [core] Fix desktop tests for py3

:100644 100644 42e0824507... aae71c4547... M    desktop/core/src/desktop/api2.py
:100644 100644 ac8db83a2d... 484d6012c4... M    desktop/core/src/desktop/api_tests.py
:100644 100644 58f869112a... a150c33e8b... M    desktop/core/src/desktop/document2_tests.py
:100644 100644 f9f78193fd... 0b1b0f1f87... M    desktop/core/src/desktop/redaction/tests.py
:100644 100644 44f9ae1ba0... 29ce814656... M    desktop/core/src/desktop/tests.py


  • 0
  • 0
  • 1
  • 1
  • 2
Description From Last Updated
romain
  1. 
      
  2. desktop/core/src/desktop/api_tests.py (Diff revision 1)
     
     

    Are you sure about this?

    This should be the same in both Python version.

    1. In py2, json.dumps(*permissions) return '"read"', but a dict object. So it was a bug.
      In py3, it returns excetpion:
      
      ======================================================================
      ERROR: desktop.api_tests.TestDocModelTags.test_tag_errors
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/Users/yingchen/mtv_cloudera/Make_apps/hue/build/env/lib/python3.6/site-packages/nose/case.py", line 198, in runTest
          self.test(*self.arg)
        File "/Users/yingchen/mtv_cloudera/Make_apps/hue/desktop/core/src/desktop/api_tests.py", line 152, in test_tag_errors
          self.share_doc_read_only(doc)
        File "/Users/yingchen/mtv_cloudera/Make_apps/hue/desktop/core/src/desktop/api_tests.py", line 75, in share_doc_read_only
          'group_ids': []
        File "/Users/yingchen/mtv_cloudera/Make_apps/hue/desktop/core/src/desktop/api_tests.py", line 62, in share_doc
          'data': json.dumps(*permissions)
      TypeError: dumps() takes 1 positional argument but 2 were given
  3. 
      
romain
  1. 
      
  2. desktop/core/src/desktop/api_tests.py (Diff revision 1)
     
     

    Thanks!

  3. 
      
Loading...