[tic-core] systemd: service file for systemd at boot time
[archive/20170607/tools/tic-core.git] / test / test_repodata.py
index 16ccbf8..d23a2c7 100644 (file)
@@ -1,14 +1,11 @@
 #!/usr/bin/python
-# Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+# Copyright (c) 2016 Samsung Electronics Co., Ltd
 #
-# Contact: 
-# @author Chulwoo Shin <cw1.shin@samsung.com>
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
+# Licensed under the Flora License, Version 1.1 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
-# http://www.apache.org/licenses/LICENSE-2.0
+#     http://floralicense.org/license/
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # - S-Core Co., Ltd
 
 import os
-import base64
 import unittest
-
-from tic.repo import Repo
 from tic.repo import get_repodata_from_repos
 
 CWD = os.path.dirname(__file__) or '.'
@@ -36,11 +30,15 @@ def suite():
 class RepodataTest(unittest.TestCase):
     def setUp(self):
         # test environment setup
-        self.local_repo = ['file:/' + TEST_REPODATA_LOC + '/base',
-                           'file:/' + TEST_REPODATA_LOC + '/mobile']
+        self.local_repo = [{'name': 'local_base',
+                            'url': 'file:/' + TEST_REPODATA_LOC + '/base'},
+                           {'name': 'local_mobile',
+                            'url': 'file:/' + TEST_REPODATA_LOC + '/mobile'}]
         
-        self.remote_repo = ['http://download.tizen.org/snapshots/tizen/base/latest/repos/arm64/packages', 
-                            'http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages']
+        self.remote_repo = [{'name': 'local_base',
+                            'url': 'http://download.tizen.org/snapshots/tizen/base/latest/repos/arm64/packages'},
+                            {'name': 'local_mobile',
+                             'url': 'http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages'}]
 
     def tearDown(self):
         # clear environment after test 
@@ -48,10 +46,7 @@ class RepodataTest(unittest.TestCase):
         del self.remote_repo
 
     def test_local_repodata(self):
-        repos = []
-        for repo_url in self.local_repo:
-            repos.append(Repo(base64.urlsafe_b64encode(repo_url), repo_url))
-        repodata_list = get_repodata_from_repos(repos, DEFAULT_CACHEDIR)
+        repodata_list = get_repodata_from_repos(self.local_repo, DEFAULT_CACHEDIR)
         
         for repo_info in repodata_list: 
             self.assertNotEqual(repo_info, None)
@@ -63,10 +58,7 @@ class RepodataTest(unittest.TestCase):
                 raise self.failureException
     
     def test_remote_repodata(self):
-        repos = []
-        for repo_url in self.remote_repo:
-            repos.append(Repo(base64.urlsafe_b64encode(repo_url), repo_url))
-        repodata_list = get_repodata_from_repos(repos, DEFAULT_CACHEDIR)
+        repodata_list = get_repodata_from_repos(self.remote_repo, DEFAULT_CACHEDIR)
         
         for repo_info in repodata_list: 
             self.assertNotEqual(repo_info, None)