def test_build_path_list(self):
     f = os.path.join(os.path.dirname(os.path.abspath(__file__)), "satellite_generated_data.bin")
     data = open(f, 'rb').read()
     pt = PathTree(data)
     paths = []
     pt.build_path_list(paths)
     expected = [
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/optional/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/rh-common/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/rhn-tools/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/7Server/$basearch/extras/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/7Server/$basearch/sat-tools/6.3/os'
     ]
     # Assert the lists contain the same items regardless of order
     six.assertCountEqual(self, expected, paths)
Esempio n. 2
0
 def test_build_path_list(self):
     f = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                      "satellite_generated_data.bin")
     data = open(f, 'rb').read()
     pt = PathTree(data)
     paths = []
     pt.build_path_list(paths)
     expected = [
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/optional/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/rh-common/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/$releasever/$basearch/rhn-tools/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/7Server/$basearch/extras/os',
         '/DPS_Satellite/Library/WF-RHEL-7-CV-2018_33-OS/content/dist/rhel/server/7/7Server/$basearch/sat-tools/6.3/os'
     ]
     # Assert the lists contain the same items regardless of order
     six.assertCountEqual(self, expected, paths)