forked from opencollab/debile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_repo_info.py
52 lines (41 loc) · 1.48 KB
/
test_repo_info.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
from debile.master.orm import Group
from debile.master.utils import init_master
config = init_master(confpath='tests/resources/master.yaml')
g = Group(name="foo")
def test_repo_info():
c = config['repo']
config['repo'] = {
"repo_path": "/srv/debile/pool/{name}",
"repo_url": "http://localhost/debile/pool/{name}",
"files_path": "/srv/debile/files/{name}",
"files_url": "http://localhost/debile/files/{name}",
}
assert g.get_repo_info() == {
"repo_path": "/srv/debile/pool/foo",
"repo_url": "http://localhost/debile/pool/foo",
"files_path": "/srv/debile/files/foo",
"files_url": "http://localhost/debile/files/foo",
}
config['repo'] = c
def fnord(group, conf):
return {"foo": "bar"}
def test_repo_info():
c = config['repo']
config['repo'] = {
"custom_resolver": "%s.fnord" % (__name__)
}
assert g.get_repo_info() == {"foo": "bar"}
config['repo'] = c
def test_repo_props():
c = config['repo']
config['repo'] = {
"repo_path": "/srv/debile/pool/{name}",
"repo_url": "http://localhost/debile/pool/{name}",
"files_path": "/srv/debile/files/{name}",
"files_url": "http://localhost/debile/files/{name}",
}
assert g.repo_path == "/srv/debile/pool/foo"
assert g.repo_url == "http://localhost/debile/pool/foo"
assert g.files_path == "/srv/debile/files/foo"
assert g.files_url == "http://localhost/debile/files/foo"
config['repo'] = c