-
Notifications
You must be signed in to change notification settings - Fork 96
/
repository_tests.py
75 lines (64 loc) · 3.42 KB
/
repository_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import unittest
import os
import os.path
from osclib.core import repository_path_expand
from . import OBSLocal
FIXTURES = os.path.join(os.getcwd(), 'tests/fixtures/repository')
class TestRepository(unittest.TestCase):
def setUp(self):
super(TestRepository, self).setUp()
self.wf = OBSLocal.FactoryWorkflow()
def tearDown(self):
del self.wf
super(TestRepository, self).tearDown()
def add_project(self, name):
prj = self.wf.create_project(name)
with open(os.path.join(FIXTURES, name + '.xml')) as f:
prj.custom_meta(f.read())
def test_sp5_setup(self):
self.add_project('SUSE:SLE-12:GA')
self.add_project('SUSE:SLE-12:Update')
self.add_project('SUSE:SLE-12-SP1:GA')
self.add_project('SUSE:SLE-12-SP1:Update')
self.add_project('SUSE:SLE-12-SP2:GA')
self.add_project('SUSE:SLE-12-SP2:Update')
self.add_project('SUSE:SLE-12-SP3:GA')
self.add_project('SUSE:SLE-12-SP3:Update')
self.add_project('SUSE:SLE-12-SP4:GA')
self.add_project('SUSE:SLE-12-SP4:Update')
self.add_project('SUSE:SLE-12-SP5:GA')
self.add_project('SUSE:SLE-12-SP5:GA:Staging:A')
repos = repository_path_expand(self.wf.api.apiurl, 'SUSE:SLE-12-SP5:GA', 'standard')
self.assertEqual([['SUSE:SLE-12-SP5:GA', 'standard'],
['SUSE:SLE-12-SP4:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP4:GA', 'standard'],
['SUSE:SLE-12-SP3:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP3:GA', 'standard'],
['SUSE:SLE-12-SP2:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP2:GA', 'standard'],
['SUSE:SLE-12-SP1:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP1:GA', 'standard'],
['SUSE:SLE-12:Update', 'snapshot-SP5'],
['SUSE:SLE-12:GA', 'standard']], repos)
repos = repository_path_expand(self.wf.api.apiurl, 'SUSE:SLE-12-SP5:GA:Staging:A', 'standard')
self.assertEqual([['SUSE:SLE-12-SP5:GA:Staging:A', 'standard'],
['SUSE:SLE-12-SP5:GA', 'ports'],
['SUSE:SLE-12-SP4:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP4:GA', 'standard'],
['SUSE:SLE-12-SP3:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP3:GA', 'standard'],
['SUSE:SLE-12-SP2:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP2:GA', 'standard'],
['SUSE:SLE-12-SP1:Update', 'snapshot-SP5'],
['SUSE:SLE-12-SP1:GA', 'standard'],
['SUSE:SLE-12:Update', 'snapshot-SP5'],
['SUSE:SLE-12:GA', 'standard']], repos)
def test_factory_staging(self):
self.add_project('openSUSE:Factory')
self.add_project('openSUSE:Factory:Staging')
self.add_project('openSUSE:Factory:Staging:H')
repos = repository_path_expand(self.wf.api.apiurl, 'openSUSE:Factory:Staging:H', 'standard')
self.assertEqual([['openSUSE:Factory:Staging:H', 'standard'],
['openSUSE:Factory:Staging:H', 'bootstrap_copy'],
['openSUSE:Factory:Staging', 'standard'],
['openSUSE:Factory', 'ports']], repos)