瀏覽代碼

Fix tests on Python 3

Unlike in Python 2:
- `range` doesn't return a list.
- `dict.keys` doesn't return a list.
Rodolfo Carvalho 8 年之前
父節點
當前提交
c321abec12
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      roles/lib_utils/library/repoquery.py
  2. 1 1
      roles/lib_utils/src/test/unit/yedit_test.py

+ 1 - 1
roles/lib_utils/library/repoquery.py

@@ -477,7 +477,7 @@ class Repoquery(RepoqueryCLI):
         ''' Gather and present the versions of each package '''
 
         versions_dict = {}
-        versions_dict['available_versions_full'] = formatted_versions.keys()
+        versions_dict['available_versions_full'] = list(formatted_versions.keys())
 
         # set the match version, if called
         if self.match_version:

+ 1 - 1
roles/lib_utils/src/test/unit/yedit_test.py

@@ -256,7 +256,7 @@ class YeditTest(unittest.TestCase):
 
     def test_pop_list_item_2(self):
         '''test dict value with none value'''
-        z = range(10)
+        z = list(range(10))
         yed = Yedit(content=z, separator=':')
         yed.pop('', 5)
         z.pop(5)