Show More
@@ -1,38 +1,36 | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
3 | class TestChangelogController(TestController): |
|
3 | class TestChangelogController(TestController): | |
4 |
|
4 | |||
5 | def test_index_hg(self): |
|
5 | def test_index_hg(self): | |
6 | self.log_user() |
|
6 | self.log_user() | |
7 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO)) |
|
7 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO)) | |
8 |
|
8 | |||
9 | print response.body |
|
|||
10 | assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes' |
|
9 | assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes' | |
11 | assert """<div class="date">commit 154: 5e204e7583b9@2010-08-10 01:18:46</div>""" in response.body , 'no info on this commit' |
|
10 | assert """<div class="date">commit 154: 5e204e7583b9@2010-08-10 01:18:46</div>""" in response.body , 'no info on this commit' | |
12 | assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' |
|
11 | assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' | |
13 | assert """<span class="removed tooltip" tooltip_title="removed: No Files">0</span>""" in response.body, 'wrong info about removed nodes' |
|
12 | assert """<span class="removed tooltip" tooltip_title="removed: No Files">0</span>""" in response.body, 'wrong info about removed nodes' | |
14 | assert """<span class="changed tooltip" tooltip_title="changed: vcs/backends/hg.py<br/> vcs/web/simplevcs/models.py">2</span>""" in response.body, 'wrong info about changed nodes' |
|
13 | assert """<span class="changed tooltip" tooltip_title="changed: vcs/backends/hg.py<br/> vcs/web/simplevcs/models.py">2</span>""" in response.body, 'wrong info about changed nodes' | |
15 | assert """<span class="added tooltip" tooltip_title="added: vcs/web/simplevcs/managers.py">1</span>""" in response.body, 'wrong info about added nodes' |
|
14 | assert """<span class="added tooltip" tooltip_title="added: vcs/web/simplevcs/managers.py">1</span>""" in response.body, 'wrong info about added nodes' | |
16 |
|
15 | |||
17 | #pagination |
|
16 | #pagination | |
18 |
|
17 | |||
19 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':1}) |
|
18 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':1}) | |
20 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':2}) |
|
19 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':2}) | |
21 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':3}) |
|
20 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':3}) | |
22 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':4}) |
|
21 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':4}) | |
23 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':5}) |
|
22 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':5}) | |
24 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':6}) |
|
23 | response = self.app.get(url(controller='changelog', action='index', repo_name=HG_REPO), {'page':6}) | |
25 |
|
24 | |||
26 | # Test response after pagination... |
|
25 | # Test response after pagination... | |
27 | print response.body |
|
|||
28 | assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64' |
|
26 | assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64' | |
29 | assert """<span class="removed tooltip" tooltip_title="removed: docs/api.rst">1</span>"""in response.body, 'wrong info about number of removed' |
|
27 | assert """<span class="removed tooltip" tooltip_title="removed: docs/api.rst">1</span>"""in response.body, 'wrong info about number of removed' | |
30 | assert """<span class="changed tooltip" tooltip_title="changed: .hgignore<br/> README.rst<br/> docs/conf.py<br/> docs/index.rst<br/> setup.py<br/> tests/test_hg.py<br/> tests/test_nodes.py<br/> vcs/__init__.py<br/> vcs/backends/__init__.py<br/> vcs/backends/base.py<br/> vcs/backends/hg.py<br/> vcs/nodes.py<br/> vcs/utils/__init__.py">13</span>"""in response.body, 'wrong info about number of changes' |
|
28 | assert """<span class="changed tooltip" tooltip_title="changed: .hgignore<br/> README.rst<br/> docs/conf.py<br/> docs/index.rst<br/> setup.py<br/> tests/test_hg.py<br/> tests/test_nodes.py<br/> vcs/__init__.py<br/> vcs/backends/__init__.py<br/> vcs/backends/base.py<br/> vcs/backends/hg.py<br/> vcs/nodes.py<br/> vcs/utils/__init__.py">13</span>"""in response.body, 'wrong info about number of changes' | |
31 | assert """<span class="added tooltip" tooltip_title="added: docs/api/backends/hg.rst<br/> docs/api/backends/index.rst<br/> docs/api/index.rst<br/> docs/api/nodes.rst<br/> docs/api/web/index.rst<br/> docs/api/web/simplevcs.rst<br/> docs/installation.rst<br/> docs/quickstart.rst<br/> setup.cfg<br/> vcs/utils/baseui_config.py<br/> vcs/utils/web.py<br/> vcs/web/__init__.py<br/> vcs/web/exceptions.py<br/> vcs/web/simplevcs/__init__.py<br/> vcs/web/simplevcs/exceptions.py<br/> vcs/web/simplevcs/middleware.py<br/> vcs/web/simplevcs/models.py<br/> vcs/web/simplevcs/settings.py<br/> vcs/web/simplevcs/utils.py<br/> vcs/web/simplevcs/views.py">20</span>"""in response.body, 'wrong info about number of added' |
|
29 | assert """<span class="added tooltip" tooltip_title="added: docs/api/backends/hg.rst<br/> docs/api/backends/index.rst<br/> docs/api/index.rst<br/> docs/api/nodes.rst<br/> docs/api/web/index.rst<br/> docs/api/web/simplevcs.rst<br/> docs/installation.rst<br/> docs/quickstart.rst<br/> setup.cfg<br/> vcs/utils/baseui_config.py<br/> vcs/utils/web.py<br/> vcs/web/__init__.py<br/> vcs/web/exceptions.py<br/> vcs/web/simplevcs/__init__.py<br/> vcs/web/simplevcs/exceptions.py<br/> vcs/web/simplevcs/middleware.py<br/> vcs/web/simplevcs/models.py<br/> vcs/web/simplevcs/settings.py<br/> vcs/web/simplevcs/utils.py<br/> vcs/web/simplevcs/views.py">20</span>"""in response.body, 'wrong info about number of added' | |
32 | assert """<div class="message"><a href="/%s/changeset/46ad32a4f974e45472a898c6b0acb600320579b1">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge' |
|
30 | assert """<div class="message"><a href="/%s/changeset/46ad32a4f974e45472a898c6b0acb600320579b1">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>""" % HG_REPO in response.body, 'wrong info about commit 64 is a merge' | |
33 |
|
31 | |||
34 |
|
32 | |||
35 |
|
33 | |||
36 | #def test_index_git(self): |
|
34 | #def test_index_git(self): | |
37 | # self.log_user() |
|
35 | # self.log_user() | |
38 | # response = self.app.get(url(controller='changelog', action='index', repo_name=GIT_REPO)) |
|
36 | # response = self.app.get(url(controller='changelog', action='index', repo_name=GIT_REPO)) |
@@ -1,190 +1,241 | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
|
3 | ARCHIVE_SPECS = { | |||
|
4 | '.tar.bz2': ('application/x-tar', 'tbz2', ''), | |||
|
5 | '.tar.gz': ('application/x-tar', 'tgz', ''), | |||
|
6 | '.zip': ('application/zip', 'zip', ''), | |||
|
7 | } | |||
|
8 | ||||
3 | class TestFilesController(TestController): |
|
9 | class TestFilesController(TestController): | |
4 |
|
10 | |||
5 | def test_index(self): |
|
11 | def test_index(self): | |
6 | self.log_user() |
|
12 | self.log_user() | |
7 | response = self.app.get(url(controller='files', action='index', |
|
13 | response = self.app.get(url(controller='files', action='index', | |
8 | repo_name=HG_REPO, |
|
14 | repo_name=HG_REPO, | |
9 | revision='tip', |
|
15 | revision='tip', | |
10 | f_path='/')) |
|
16 | f_path='/')) | |
11 | # Test response... |
|
17 | # Test response... | |
12 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>' in response.body, 'missing dir' |
|
18 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>' in response.body, 'missing dir' | |
13 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>' in response.body, 'missing dir' |
|
19 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>' in response.body, 'missing dir' | |
14 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>' in response.body, 'missing dir' |
|
20 | assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>' in response.body, 'missing dir' | |
15 | assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>' in response.body, 'missing file' |
|
21 | assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>' in response.body, 'missing file' | |
16 | assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>' in response.body, 'missing file' |
|
22 | assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>' in response.body, 'missing file' | |
17 |
|
23 | |||
18 |
|
24 | |||
19 | def test_index_revision(self): |
|
25 | def test_index_revision(self): | |
20 | self.log_user() |
|
26 | self.log_user() | |
21 |
|
27 | |||
22 | response = self.app.get(url(controller='files', action='index', |
|
28 | response = self.app.get(url(controller='files', action='index', | |
23 | repo_name=HG_REPO, |
|
29 | repo_name=HG_REPO, | |
24 | revision='7ba66bec8d6dbba14a2155be32408c435c5f4492', |
|
30 | revision='7ba66bec8d6dbba14a2155be32408c435c5f4492', | |
25 | f_path='/')) |
|
31 | f_path='/')) | |
26 |
|
32 | |||
27 |
|
33 | |||
28 |
|
34 | |||
29 | #Test response... |
|
35 | #Test response... | |
30 |
|
36 | |||
31 | assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>' in response.body, 'missing dir' |
|
37 | assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>' in response.body, 'missing dir' | |
32 | assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>' in response.body, 'missing dir' |
|
38 | assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>' in response.body, 'missing dir' | |
33 | assert '<a class="browser-file" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>' in response.body, 'missing file' |
|
39 | assert '<a class="browser-file" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>' in response.body, 'missing file' | |
34 | assert '1.1 KiB' in response.body, 'missing size of setup.py' |
|
40 | assert '1.1 KiB' in response.body, 'missing size of setup.py' | |
35 | assert 'text/x-python' in response.body, 'missing mimetype of setup.py' |
|
41 | assert 'text/x-python' in response.body, 'missing mimetype of setup.py' | |
36 |
|
42 | |||
37 |
|
43 | |||
38 |
|
44 | |||
39 | def test_index_different_branch(self): |
|
45 | def test_index_different_branch(self): | |
40 | self.log_user() |
|
46 | self.log_user() | |
41 |
|
47 | |||
42 | response = self.app.get(url(controller='files', action='index', |
|
48 | response = self.app.get(url(controller='files', action='index', | |
43 | repo_name=HG_REPO, |
|
49 | repo_name=HG_REPO, | |
44 | revision='97e8b885c04894463c51898e14387d80c30ed1ee', |
|
50 | revision='97e8b885c04894463c51898e14387d80c30ed1ee', | |
45 | f_path='/')) |
|
51 | f_path='/')) | |
46 |
|
52 | |||
47 |
|
53 | |||
48 |
|
54 | |||
49 | assert """<span style="text-transform: uppercase;"><a href="#">branch: git</a></span>""" in response.body, 'missing or wrong branch info' |
|
55 | assert """<span style="text-transform: uppercase;"><a href="#">branch: git</a></span>""" in response.body, 'missing or wrong branch info' | |
50 |
|
56 | |||
51 |
|
57 | |||
52 |
|
58 | |||
53 | def test_index_paging(self): |
|
59 | def test_index_paging(self): | |
54 | self.log_user() |
|
60 | self.log_user() | |
55 |
|
61 | |||
56 | for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'), |
|
62 | for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'), | |
57 | (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'), |
|
63 | (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'), | |
58 | (109, '75feb4c33e81186c87eac740cee2447330288412'), |
|
64 | (109, '75feb4c33e81186c87eac740cee2447330288412'), | |
59 | (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'), |
|
65 | (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'), | |
60 | (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]: |
|
66 | (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]: | |
61 |
|
67 | |||
62 | response = self.app.get(url(controller='files', action='index', |
|
68 | response = self.app.get(url(controller='files', action='index', | |
63 | repo_name=HG_REPO, |
|
69 | repo_name=HG_REPO, | |
64 | revision=r[1], |
|
70 | revision=r[1], | |
65 | f_path='/')) |
|
71 | f_path='/')) | |
66 |
|
72 | |||
67 | assert """@ r%s:%s""" % (r[0], r[1][:12]) in response.body, 'missing info about current revision' |
|
73 | assert """@ r%s:%s""" % (r[0], r[1][:12]) in response.body, 'missing info about current revision' | |
68 |
|
74 | |||
69 | def test_file_source(self): |
|
75 | def test_file_source(self): | |
70 | self.log_user() |
|
76 | self.log_user() | |
71 | response = self.app.get(url(controller='files', action='index', |
|
77 | response = self.app.get(url(controller='files', action='index', | |
72 | repo_name=HG_REPO, |
|
78 | repo_name=HG_REPO, | |
73 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
79 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
74 | f_path='vcs/nodes.py')) |
|
80 | f_path='vcs/nodes.py')) | |
75 |
|
81 | |||
76 | #test or history |
|
82 | #test or history | |
77 | assert """<optgroup label="Changesets"> |
|
83 | assert """<optgroup label="Changesets"> | |
78 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option> |
|
84 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option> | |
79 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option> |
|
85 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option> | |
80 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option> |
|
86 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option> | |
81 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option> |
|
87 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option> | |
82 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option> |
|
88 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option> | |
83 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option> |
|
89 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option> | |
84 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option> |
|
90 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option> | |
85 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option> |
|
91 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option> | |
86 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option> |
|
92 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option> | |
87 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option> |
|
93 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option> | |
88 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option> |
|
94 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option> | |
89 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option> |
|
95 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option> | |
90 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b</option> |
|
96 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b</option> | |
91 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455</option> |
|
97 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455</option> | |
92 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32</option> |
|
98 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32</option> | |
93 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0</option> |
|
99 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0</option> | |
94 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081</option> |
|
100 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081</option> | |
95 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad</option> |
|
101 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad</option> | |
96 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7</option> |
|
102 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7</option> | |
97 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059</option> |
|
103 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059</option> | |
98 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb</option> |
|
104 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb</option> | |
99 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1</option> |
|
105 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1</option> | |
100 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71</option> |
|
106 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71</option> | |
101 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771</option> |
|
107 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771</option> | |
102 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option> |
|
108 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option> | |
103 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option> |
|
109 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option> | |
104 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option> |
|
110 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option> | |
105 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option> |
|
111 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option> | |
106 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option> |
|
112 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option> | |
107 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option> |
|
113 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option> | |
108 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option> |
|
114 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option> | |
109 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option> |
|
115 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option> | |
110 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option> |
|
116 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option> | |
111 | </optgroup> |
|
117 | </optgroup> | |
112 | <optgroup label="Branches"> |
|
118 | <optgroup label="Branches"> | |
113 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
|
119 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> | |
114 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
|
120 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> | |
115 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
|
121 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> | |
116 | </optgroup> |
|
122 | </optgroup> | |
117 | <optgroup label="Tags"> |
|
123 | <optgroup label="Tags"> | |
118 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
|
124 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> | |
119 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
|
125 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> | |
120 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
|
126 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> | |
121 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
|
127 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> | |
122 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
|
128 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> | |
123 | </optgroup>""" in response.body |
|
129 | </optgroup>""" in response.body | |
124 |
|
130 | |||
125 |
|
131 | |||
126 | assert """<div class="commit">"Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. |
|
132 | assert """<div class="commit">"Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. | |
127 | In addition some other __str__ are unicode as well |
|
133 | In addition some other __str__ are unicode as well | |
128 | Added test for unicode |
|
134 | Added test for unicode | |
129 | Improved test to clone into uniq repository. |
|
135 | Improved test to clone into uniq repository. | |
130 | removed extra unicode conversion in diff."</div>""" in response.body |
|
136 | removed extra unicode conversion in diff."</div>""" in response.body | |
131 |
|
137 | |||
132 | assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info' |
|
138 | assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info' | |
133 |
|
139 | |||
134 | def test_file_annotation(self): |
|
140 | def test_file_annotation(self): | |
135 | self.log_user() |
|
141 | self.log_user() | |
136 | response = self.app.get(url(controller='files', action='annotate', |
|
142 | response = self.app.get(url(controller='files', action='annotate', | |
137 | repo_name=HG_REPO, |
|
143 | repo_name=HG_REPO, | |
138 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
144 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
139 | f_path='vcs/nodes.py')) |
|
145 | f_path='vcs/nodes.py')) | |
140 |
|
146 | |||
141 | print response.body |
|
147 | print response.body | |
142 | assert """<optgroup label="Changesets"> |
|
148 | assert """<optgroup label="Changesets"> | |
143 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option> |
|
149 | <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option> | |
144 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option> |
|
150 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option> | |
145 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option> |
|
151 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option> | |
146 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option> |
|
152 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option> | |
147 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option> |
|
153 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option> | |
148 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option> |
|
154 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option> | |
149 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option> |
|
155 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option> | |
150 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option> |
|
156 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option> | |
151 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option> |
|
157 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option> | |
152 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option> |
|
158 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option> | |
153 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option> |
|
159 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option> | |
154 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option> |
|
160 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option> | |
155 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b</option> |
|
161 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b</option> | |
156 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455</option> |
|
162 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455</option> | |
157 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32</option> |
|
163 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32</option> | |
158 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0</option> |
|
164 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0</option> | |
159 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081</option> |
|
165 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081</option> | |
160 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad</option> |
|
166 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad</option> | |
161 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7</option> |
|
167 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7</option> | |
162 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059</option> |
|
168 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059</option> | |
163 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb</option> |
|
169 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb</option> | |
164 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1</option> |
|
170 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1</option> | |
165 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71</option> |
|
171 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71</option> | |
166 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771</option> |
|
172 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771</option> | |
167 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option> |
|
173 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option> | |
168 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option> |
|
174 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option> | |
169 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option> |
|
175 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option> | |
170 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option> |
|
176 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option> | |
171 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option> |
|
177 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option> | |
172 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option> |
|
178 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option> | |
173 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option> |
|
179 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option> | |
174 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option> |
|
180 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option> | |
175 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option> |
|
181 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option> | |
176 | </optgroup> |
|
182 | </optgroup> | |
177 | <optgroup label="Branches"> |
|
183 | <optgroup label="Branches"> | |
178 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
|
184 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> | |
179 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
|
185 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> | |
180 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
|
186 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> | |
181 | </optgroup> |
|
187 | </optgroup> | |
182 | <optgroup label="Tags"> |
|
188 | <optgroup label="Tags"> | |
183 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
|
189 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> | |
184 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
|
190 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> | |
185 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
|
191 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> | |
186 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
|
192 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> | |
187 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
|
193 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> | |
188 | </optgroup>""" in response.body, 'missing or wrong history in annotation' |
|
194 | </optgroup>""" in response.body, 'missing or wrong history in annotation' | |
189 |
|
195 | |||
190 | assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info' |
|
196 | assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info' | |
|
197 | ||||
|
198 | ||||
|
199 | ||||
|
200 | def test_archival(self): | |||
|
201 | self.log_user() | |||
|
202 | ||||
|
203 | for arch_ext, info in ARCHIVE_SPECS.items(): | |||
|
204 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext | |||
|
205 | filename = '%s-%s' % (HG_REPO, fname) | |||
|
206 | ||||
|
207 | response = self.app.get(url(controller='files', action='archivefile', | |||
|
208 | repo_name=HG_REPO, | |||
|
209 | fname=fname)) | |||
|
210 | ||||
|
211 | assert response.status == '200 OK', 'wrong response code' | |||
|
212 | assert response.response._headers.items() == [('Pragma', 'no-cache'), | |||
|
213 | ('Cache-Control', 'no-cache'), | |||
|
214 | ('Content-Type', '%s; charset=utf-8' % info[0]), | |||
|
215 | ('Content-Disposition', 'attachment; filename=%s' % filename), ], 'wrong headers' | |||
|
216 | ||||
|
217 | def test_archival_wrong_ext(self): | |||
|
218 | self.log_user() | |||
|
219 | ||||
|
220 | for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: | |||
|
221 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext | |||
|
222 | ||||
|
223 | response = self.app.get(url(controller='files', action='archivefile', | |||
|
224 | repo_name=HG_REPO, | |||
|
225 | fname=fname)) | |||
|
226 | assert 'Unknown archive type' in response.body | |||
|
227 | ||||
|
228 | ||||
|
229 | def test_archival_wrong_revision(self): | |||
|
230 | self.log_user() | |||
|
231 | ||||
|
232 | for rev in ['00x000000', 'tar', 'wrong', '@##$@$424213232', '232dffcd']: | |||
|
233 | fname = '%s.zip' % rev | |||
|
234 | ||||
|
235 | response = self.app.get(url(controller='files', action='archivefile', | |||
|
236 | repo_name=HG_REPO, | |||
|
237 | fname=fname)) | |||
|
238 | assert 'Unknown revision' in response.body | |||
|
239 | ||||
|
240 | ||||
|
241 |
General Comments 0
You need to be logged in to leave comments.
Login now