Show More
@@ -1,318 +1,314 | |||||
1 | from rhodecode.tests import * |
|
1 | from rhodecode.tests import * | |
2 |
|
2 | |||
3 | ARCHIVE_SPECS = { |
|
3 | ARCHIVE_SPECS = { | |
4 | '.tar.bz2': ('application/x-bzip2', 'tbz2', ''), |
|
4 | '.tar.bz2': ('application/x-bzip2', 'tbz2', ''), | |
5 | '.tar.gz': ('application/x-gzip', 'tgz', ''), |
|
5 | '.tar.gz': ('application/x-gzip', 'tgz', ''), | |
6 | '.zip': ('application/zip', 'zip', ''), |
|
6 | '.zip': ('application/zip', 'zip', ''), | |
7 | } |
|
7 | } | |
8 |
|
8 | |||
9 |
|
9 | |||
10 | class TestFilesController(TestController): |
|
10 | class TestFilesController(TestController): | |
11 |
|
11 | |||
12 | def test_index(self): |
|
12 | def test_index(self): | |
13 | self.log_user() |
|
13 | self.log_user() | |
14 | response = self.app.get(url(controller='files', action='index', |
|
14 | response = self.app.get(url(controller='files', action='index', | |
15 | repo_name=HG_REPO, |
|
15 | repo_name=HG_REPO, | |
16 | revision='tip', |
|
16 | revision='tip', | |
17 | f_path='/')) |
|
17 | f_path='/')) | |
18 | # Test response... |
|
18 | # Test response... | |
19 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>') |
|
19 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>') | |
20 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>') |
|
20 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>') | |
21 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>') |
|
21 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>') | |
22 | response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>') |
|
22 | response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>') | |
23 | response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>') |
|
23 | response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>') | |
24 |
|
24 | |||
25 | def test_index_revision(self): |
|
25 | def test_index_revision(self): | |
26 | self.log_user() |
|
26 | self.log_user() | |
27 |
|
27 | |||
28 | response = self.app.get( |
|
28 | response = self.app.get( | |
29 | url(controller='files', action='index', |
|
29 | url(controller='files', action='index', | |
30 | repo_name=HG_REPO, |
|
30 | repo_name=HG_REPO, | |
31 | revision='7ba66bec8d6dbba14a2155be32408c435c5f4492', |
|
31 | revision='7ba66bec8d6dbba14a2155be32408c435c5f4492', | |
32 | f_path='/') |
|
32 | f_path='/') | |
33 | ) |
|
33 | ) | |
34 |
|
34 | |||
35 | #Test response... |
|
35 | #Test response... | |
36 |
|
36 | |||
37 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>') |
|
37 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>') | |
38 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>') |
|
38 | response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>') | |
39 | response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>') |
|
39 | response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>') | |
40 | response.mustcontain('1.1 KiB') |
|
40 | response.mustcontain('1.1 KiB') | |
41 | response.mustcontain('text/x-python') |
|
41 | response.mustcontain('text/x-python') | |
42 |
|
42 | |||
43 | def test_index_different_branch(self): |
|
43 | def test_index_different_branch(self): | |
44 | self.log_user() |
|
44 | self.log_user() | |
45 |
|
45 | |||
46 | response = self.app.get(url(controller='files', action='index', |
|
46 | response = self.app.get(url(controller='files', action='index', | |
47 | repo_name=HG_REPO, |
|
47 | repo_name=HG_REPO, | |
48 | revision='97e8b885c04894463c51898e14387d80c30ed1ee', |
|
48 | revision='97e8b885c04894463c51898e14387d80c30ed1ee', | |
49 | f_path='/')) |
|
49 | f_path='/')) | |
50 |
|
50 | |||
51 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: git</a></span>""") |
|
51 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: git</a></span>""") | |
52 |
|
52 | |||
53 | def test_index_paging(self): |
|
53 | def test_index_paging(self): | |
54 | self.log_user() |
|
54 | self.log_user() | |
55 |
|
55 | |||
56 | for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'), |
|
56 | for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'), | |
57 | (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'), |
|
57 | (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'), | |
58 | (109, '75feb4c33e81186c87eac740cee2447330288412'), |
|
58 | (109, '75feb4c33e81186c87eac740cee2447330288412'), | |
59 | (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'), |
|
59 | (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'), | |
60 | (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]: |
|
60 | (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]: | |
61 |
|
61 | |||
62 | response = self.app.get(url(controller='files', action='index', |
|
62 | response = self.app.get(url(controller='files', action='index', | |
63 | repo_name=HG_REPO, |
|
63 | repo_name=HG_REPO, | |
64 | revision=r[1], |
|
64 | revision=r[1], | |
65 | f_path='/')) |
|
65 | f_path='/')) | |
66 |
|
66 | |||
67 | response.mustcontain("""@ r%s:%s""" % (r[0], r[1][:12])) |
|
67 | response.mustcontain("""@ r%s:%s""" % (r[0], r[1][:12])) | |
68 |
|
68 | |||
69 | def test_file_source(self): |
|
69 | def test_file_source(self): | |
70 | self.log_user() |
|
70 | self.log_user() | |
71 | response = self.app.get(url(controller='files', action='index', |
|
71 | response = self.app.get(url(controller='files', action='index', | |
72 | repo_name=HG_REPO, |
|
72 | repo_name=HG_REPO, | |
73 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
73 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
74 | f_path='vcs/nodes.py')) |
|
74 | f_path='vcs/nodes.py')) | |
75 |
|
75 | |||
76 | #test or history |
|
76 | #test or history | |
77 | response.mustcontain("""<optgroup label="Changesets"> |
|
77 | response.mustcontain("""<optgroup label="Changesets"> | |
78 |
<option |
|
78 | <option value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> | |
79 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35 (default)</option> |
|
79 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35 (default)</option> | |
80 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c (default)</option> |
|
80 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c (default)</option> | |
81 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329 (default)</option> |
|
81 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329 (default)</option> | |
82 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf (git)</option> |
|
82 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf (git)</option> | |
83 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81 (default)</option> |
|
83 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81 (default)</option> | |
84 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc (default)</option> |
|
84 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc (default)</option> | |
85 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21 (default)</option> |
|
85 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21 (default)</option> | |
86 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2 (default)</option> |
|
86 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2 (default)</option> | |
87 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85 (default)</option> |
|
87 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85 (default)</option> | |
88 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2 (git)</option> |
|
88 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2 (git)</option> | |
89 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93 (default)</option> |
|
89 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93 (default)</option> | |
90 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b (default)</option> |
|
90 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b (default)</option> | |
91 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455 (default)</option> |
|
91 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455 (default)</option> | |
92 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32 (default)</option> |
|
92 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32 (default)</option> | |
93 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0 (default)</option> |
|
93 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0 (default)</option> | |
94 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081 (default)</option> |
|
94 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081 (default)</option> | |
95 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad (default)</option> |
|
95 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad (default)</option> | |
96 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7 (default)</option> |
|
96 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7 (default)</option> | |
97 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059 (web)</option> |
|
97 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059 (web)</option> | |
98 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb (web)</option> |
|
98 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb (web)</option> | |
99 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1 (web)</option> |
|
99 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1 (web)</option> | |
100 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71 (web)</option> |
|
100 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71 (web)</option> | |
101 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771 (web)</option> |
|
101 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771 (web)</option> | |
102 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526 (web)</option> |
|
102 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526 (web)</option> | |
103 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4 (web)</option> |
|
103 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4 (web)</option> | |
104 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b (web)</option> |
|
104 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b (web)</option> | |
105 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c (web)</option> |
|
105 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c (web)</option> | |
106 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1 (default)</option> |
|
106 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1 (default)</option> | |
107 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5 (default)</option> |
|
107 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5 (default)</option> | |
108 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283 (default)</option> |
|
108 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283 (default)</option> | |
109 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6 (default)</option> |
|
109 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6 (default)</option> | |
110 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3 (default)</option> |
|
110 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3 (default)</option> | |
111 | </optgroup> |
|
111 | </optgroup> | |
112 | <optgroup label="Branches"> |
|
112 | <optgroup label="Branches"> | |
113 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
|
113 | <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> | |
114 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
|
114 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> | |
115 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
|
115 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> | |
116 | </optgroup> |
|
116 | </optgroup> | |
117 | <optgroup label="Tags"> |
|
117 | <optgroup label="Tags"> | |
118 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
|
118 | <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> | |
119 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
|
119 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> | |
120 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
|
120 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> | |
121 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
|
121 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> | |
122 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
|
122 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> | |
123 |
</optgroup> |
|
123 | </optgroup> | |
|
124 | """) | |||
124 |
|
125 | |||
125 | response.mustcontain("""<div class="commit">Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. |
|
126 | response.mustcontain("""<div class="commit">merge</div>""") | |
126 | In addition some other __str__ are unicode as well |
|
|||
127 | Added test for unicode |
|
|||
128 | Improved test to clone into uniq repository. |
|
|||
129 | removed extra unicode conversion in diff.</div>""") |
|
|||
130 |
|
127 | |||
131 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") |
|
128 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") | |
132 |
|
129 | |||
133 | def test_file_annotation(self): |
|
130 | def test_file_annotation(self): | |
134 | self.log_user() |
|
131 | self.log_user() | |
135 | response = self.app.get(url(controller='files', action='annotate', |
|
132 | response = self.app.get(url(controller='files', action='annotate', | |
136 | repo_name=HG_REPO, |
|
133 | repo_name=HG_REPO, | |
137 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
134 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
138 | f_path='vcs/nodes.py')) |
|
135 | f_path='vcs/nodes.py')) | |
139 |
|
136 | |||
140 |
|
137 | |||
141 | response.mustcontain("""<optgroup label="Changesets"> |
|
138 | response.mustcontain("""<optgroup label="Changesets"> | |
142 |
<option |
|
139 | <option value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> | |
143 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35 (default)</option> |
|
140 | <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35 (default)</option> | |
144 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c (default)</option> |
|
141 | <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c (default)</option> | |
145 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329 (default)</option> |
|
142 | <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329 (default)</option> | |
146 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf (git)</option> |
|
143 | <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf (git)</option> | |
147 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81 (default)</option> |
|
144 | <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81 (default)</option> | |
148 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc (default)</option> |
|
145 | <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc (default)</option> | |
149 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21 (default)</option> |
|
146 | <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21 (default)</option> | |
150 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2 (default)</option> |
|
147 | <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2 (default)</option> | |
151 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85 (default)</option> |
|
148 | <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85 (default)</option> | |
152 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2 (git)</option> |
|
149 | <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2 (git)</option> | |
153 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93 (default)</option> |
|
150 | <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93 (default)</option> | |
154 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b (default)</option> |
|
151 | <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b (default)</option> | |
155 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455 (default)</option> |
|
152 | <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455 (default)</option> | |
156 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32 (default)</option> |
|
153 | <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32 (default)</option> | |
157 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0 (default)</option> |
|
154 | <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0 (default)</option> | |
158 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081 (default)</option> |
|
155 | <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081 (default)</option> | |
159 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad (default)</option> |
|
156 | <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad (default)</option> | |
160 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7 (default)</option> |
|
157 | <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7 (default)</option> | |
161 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059 (web)</option> |
|
158 | <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059 (web)</option> | |
162 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb (web)</option> |
|
159 | <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb (web)</option> | |
163 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1 (web)</option> |
|
160 | <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1 (web)</option> | |
164 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71 (web)</option> |
|
161 | <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71 (web)</option> | |
165 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771 (web)</option> |
|
162 | <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771 (web)</option> | |
166 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526 (web)</option> |
|
163 | <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526 (web)</option> | |
167 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4 (web)</option> |
|
164 | <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4 (web)</option> | |
168 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b (web)</option> |
|
165 | <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b (web)</option> | |
169 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c (web)</option> |
|
166 | <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c (web)</option> | |
170 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1 (default)</option> |
|
167 | <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1 (default)</option> | |
171 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5 (default)</option> |
|
168 | <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5 (default)</option> | |
172 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283 (default)</option> |
|
169 | <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283 (default)</option> | |
173 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6 (default)</option> |
|
170 | <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6 (default)</option> | |
174 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3 (default)</option> |
|
171 | <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3 (default)</option> | |
175 | </optgroup> |
|
172 | </optgroup> | |
176 | <optgroup label="Branches"> |
|
173 | <optgroup label="Branches"> | |
177 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
|
174 | <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> | |
178 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
|
175 | <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> | |
179 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
|
176 | <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> | |
180 | </optgroup> |
|
177 | </optgroup> | |
181 | <optgroup label="Tags"> |
|
178 | <optgroup label="Tags"> | |
182 | <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
|
179 | <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> | |
183 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
|
180 | <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> | |
184 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
|
181 | <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> | |
185 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
|
182 | <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> | |
186 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
|
183 | <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> | |
187 | </optgroup> |
|
184 | </optgroup>""") | |
188 | """) |
|
|||
189 |
|
185 | |||
190 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") |
|
186 | response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") | |
191 |
|
187 | |||
192 | def test_archival(self): |
|
188 | def test_archival(self): | |
193 | self.log_user() |
|
189 | self.log_user() | |
194 |
|
190 | |||
195 | for arch_ext, info in ARCHIVE_SPECS.items(): |
|
191 | for arch_ext, info in ARCHIVE_SPECS.items(): | |
196 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext |
|
192 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext | |
197 | filename = '%s-%s' % (HG_REPO, fname) |
|
193 | filename = '%s-%s' % (HG_REPO, fname) | |
198 |
|
194 | |||
199 | response = self.app.get(url(controller='files', action='archivefile', |
|
195 | response = self.app.get(url(controller='files', action='archivefile', | |
200 | repo_name=HG_REPO, |
|
196 | repo_name=HG_REPO, | |
201 | fname=fname)) |
|
197 | fname=fname)) | |
202 |
|
198 | |||
203 | assert response.status == '200 OK', 'wrong response code' |
|
199 | assert response.status == '200 OK', 'wrong response code' | |
204 | assert response.response._headers.items() == [('Pragma', 'no-cache'), |
|
200 | assert response.response._headers.items() == [('Pragma', 'no-cache'), | |
205 | ('Cache-Control', 'no-cache'), |
|
201 | ('Cache-Control', 'no-cache'), | |
206 | ('Content-Type', '%s; charset=utf-8' % info[0]), |
|
202 | ('Content-Type', '%s; charset=utf-8' % info[0]), | |
207 | ('Content-Disposition', 'attachment; filename=%s' % filename), ], 'wrong headers' |
|
203 | ('Content-Disposition', 'attachment; filename=%s' % filename), ], 'wrong headers' | |
208 |
|
204 | |||
209 | def test_archival_wrong_ext(self): |
|
205 | def test_archival_wrong_ext(self): | |
210 | self.log_user() |
|
206 | self.log_user() | |
211 |
|
207 | |||
212 | for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: |
|
208 | for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: | |
213 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext |
|
209 | fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext | |
214 |
|
210 | |||
215 | response = self.app.get(url(controller='files', action='archivefile', |
|
211 | response = self.app.get(url(controller='files', action='archivefile', | |
216 | repo_name=HG_REPO, |
|
212 | repo_name=HG_REPO, | |
217 | fname=fname)) |
|
213 | fname=fname)) | |
218 | assert 'Unknown archive type' in response.body |
|
214 | assert 'Unknown archive type' in response.body | |
219 |
|
215 | |||
220 |
|
216 | |||
221 | def test_archival_wrong_revision(self): |
|
217 | def test_archival_wrong_revision(self): | |
222 | self.log_user() |
|
218 | self.log_user() | |
223 |
|
219 | |||
224 | for rev in ['00x000000', 'tar', 'wrong', '@##$@$424213232', '232dffcd']: |
|
220 | for rev in ['00x000000', 'tar', 'wrong', '@##$@$424213232', '232dffcd']: | |
225 | fname = '%s.zip' % rev |
|
221 | fname = '%s.zip' % rev | |
226 |
|
222 | |||
227 | response = self.app.get(url(controller='files', action='archivefile', |
|
223 | response = self.app.get(url(controller='files', action='archivefile', | |
228 | repo_name=HG_REPO, |
|
224 | repo_name=HG_REPO, | |
229 | fname=fname)) |
|
225 | fname=fname)) | |
230 | assert 'Unknown revision' in response.body |
|
226 | assert 'Unknown revision' in response.body | |
231 |
|
227 | |||
232 | #========================================================================== |
|
228 | #========================================================================== | |
233 | # RAW FILE |
|
229 | # RAW FILE | |
234 | #========================================================================== |
|
230 | #========================================================================== | |
235 | def test_raw_file_ok(self): |
|
231 | def test_raw_file_ok(self): | |
236 | self.log_user() |
|
232 | self.log_user() | |
237 | response = self.app.get(url(controller='files', action='rawfile', |
|
233 | response = self.app.get(url(controller='files', action='rawfile', | |
238 | repo_name=HG_REPO, |
|
234 | repo_name=HG_REPO, | |
239 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
235 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
240 | f_path='vcs/nodes.py')) |
|
236 | f_path='vcs/nodes.py')) | |
241 |
|
237 | |||
242 | assert response.content_disposition == "attachment; filename=nodes.py" |
|
238 | assert response.content_disposition == "attachment; filename=nodes.py" | |
243 | assert response.content_type == "text/x-python" |
|
239 | assert response.content_type == "text/x-python" | |
244 |
|
240 | |||
245 | def test_raw_file_wrong_cs(self): |
|
241 | def test_raw_file_wrong_cs(self): | |
246 | self.log_user() |
|
242 | self.log_user() | |
247 | rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc' |
|
243 | rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc' | |
248 | f_path = 'vcs/nodes.py' |
|
244 | f_path = 'vcs/nodes.py' | |
249 |
|
245 | |||
250 | response = self.app.get(url(controller='files', action='rawfile', |
|
246 | response = self.app.get(url(controller='files', action='rawfile', | |
251 | repo_name=HG_REPO, |
|
247 | repo_name=HG_REPO, | |
252 | revision=rev, |
|
248 | revision=rev, | |
253 | f_path=f_path)) |
|
249 | f_path=f_path)) | |
254 |
|
250 | |||
255 | msg = """Revision %r does not exist for this repository""" % (rev) |
|
251 | msg = """Revision %r does not exist for this repository""" % (rev) | |
256 | self.checkSessionFlash(response, msg) |
|
252 | self.checkSessionFlash(response, msg) | |
257 |
|
253 | |||
258 | msg = """%s""" % (HG_REPO) |
|
254 | msg = """%s""" % (HG_REPO) | |
259 | self.checkSessionFlash(response, msg) |
|
255 | self.checkSessionFlash(response, msg) | |
260 |
|
256 | |||
261 | def test_raw_file_wrong_f_path(self): |
|
257 | def test_raw_file_wrong_f_path(self): | |
262 | self.log_user() |
|
258 | self.log_user() | |
263 | rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' |
|
259 | rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
264 | f_path = 'vcs/ERRORnodes.py' |
|
260 | f_path = 'vcs/ERRORnodes.py' | |
265 | response = self.app.get(url(controller='files', action='rawfile', |
|
261 | response = self.app.get(url(controller='files', action='rawfile', | |
266 | repo_name=HG_REPO, |
|
262 | repo_name=HG_REPO, | |
267 | revision=rev, |
|
263 | revision=rev, | |
268 | f_path=f_path)) |
|
264 | f_path=f_path)) | |
269 |
|
265 | |||
270 | msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) |
|
266 | msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) | |
271 | self.checkSessionFlash(response, msg) |
|
267 | self.checkSessionFlash(response, msg) | |
272 |
|
268 | |||
273 | #========================================================================== |
|
269 | #========================================================================== | |
274 | # RAW RESPONSE - PLAIN |
|
270 | # RAW RESPONSE - PLAIN | |
275 | #========================================================================== |
|
271 | #========================================================================== | |
276 | def test_raw_ok(self): |
|
272 | def test_raw_ok(self): | |
277 | self.log_user() |
|
273 | self.log_user() | |
278 | response = self.app.get(url(controller='files', action='raw', |
|
274 | response = self.app.get(url(controller='files', action='raw', | |
279 | repo_name=HG_REPO, |
|
275 | repo_name=HG_REPO, | |
280 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
276 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
281 | f_path='vcs/nodes.py')) |
|
277 | f_path='vcs/nodes.py')) | |
282 |
|
278 | |||
283 | assert response.content_type == "text/plain" |
|
279 | assert response.content_type == "text/plain" | |
284 |
|
280 | |||
285 | def test_raw_wrong_cs(self): |
|
281 | def test_raw_wrong_cs(self): | |
286 | self.log_user() |
|
282 | self.log_user() | |
287 | rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' |
|
283 | rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' | |
288 | f_path = 'vcs/nodes.py' |
|
284 | f_path = 'vcs/nodes.py' | |
289 |
|
285 | |||
290 | response = self.app.get(url(controller='files', action='raw', |
|
286 | response = self.app.get(url(controller='files', action='raw', | |
291 | repo_name=HG_REPO, |
|
287 | repo_name=HG_REPO, | |
292 | revision=rev, |
|
288 | revision=rev, | |
293 | f_path=f_path)) |
|
289 | f_path=f_path)) | |
294 | msg = """Revision %r does not exist for this repository""" % (rev) |
|
290 | msg = """Revision %r does not exist for this repository""" % (rev) | |
295 | self.checkSessionFlash(response, msg) |
|
291 | self.checkSessionFlash(response, msg) | |
296 |
|
292 | |||
297 | msg = """%s""" % (HG_REPO) |
|
293 | msg = """%s""" % (HG_REPO) | |
298 | self.checkSessionFlash(response, msg) |
|
294 | self.checkSessionFlash(response, msg) | |
299 |
|
295 | |||
300 | def test_raw_wrong_f_path(self): |
|
296 | def test_raw_wrong_f_path(self): | |
301 | self.log_user() |
|
297 | self.log_user() | |
302 | rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' |
|
298 | rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
303 | f_path = 'vcs/ERRORnodes.py' |
|
299 | f_path = 'vcs/ERRORnodes.py' | |
304 | response = self.app.get(url(controller='files', action='raw', |
|
300 | response = self.app.get(url(controller='files', action='raw', | |
305 | repo_name=HG_REPO, |
|
301 | repo_name=HG_REPO, | |
306 | revision=rev, |
|
302 | revision=rev, | |
307 | f_path=f_path)) |
|
303 | f_path=f_path)) | |
308 | msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) |
|
304 | msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) | |
309 | self.checkSessionFlash(response, msg) |
|
305 | self.checkSessionFlash(response, msg) | |
310 |
|
306 | |||
311 | def test_ajaxed_files_list(self): |
|
307 | def test_ajaxed_files_list(self): | |
312 | self.log_user() |
|
308 | self.log_user() | |
313 | rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' |
|
309 | rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
314 | response = self.app.get( |
|
310 | response = self.app.get( | |
315 | url('files_nodelist_home', repo_name=HG_REPO,f_path='/',revision=rev), |
|
311 | url('files_nodelist_home', repo_name=HG_REPO,f_path='/',revision=rev), | |
316 | extra_environ={'HTTP_X_PARTIAL_XHR': '1'}, |
|
312 | extra_environ={'HTTP_X_PARTIAL_XHR': '1'}, | |
317 | ) |
|
313 | ) | |
318 | response.mustcontain("vcs/web/simplevcs/views/repository.py") |
|
314 | response.mustcontain("vcs/web/simplevcs/views/repository.py") |
General Comments 0
You need to be logged in to leave comments.
Login now