Mercurial > kallithea
annotate rhodecode/tests/functional/test_files.py @ 2679:dffb92224edf beta
removed ftp from allowed schemas
- added tests for the schemas fix
- moved parsing url if we only have came_from present
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 31 Jul 2012 12:15:54 +0200 |
parents | 402a96fcfa22 |
children | 01f5633ee68b |
rev | line source |
---|---|
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
1 from rhodecode.tests import * |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
2 |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
3 ARCHIVE_SPECS = { |
951
48896664e987
fixes for issue #104, code rewrites for vcs 0.2
Marcin Kuzminski <marcin@python-works.com>
parents:
873
diff
changeset
|
4 '.tar.bz2': ('application/x-bzip2', 'tbz2', ''), |
48896664e987
fixes for issue #104, code rewrites for vcs 0.2
Marcin Kuzminski <marcin@python-works.com>
parents:
873
diff
changeset
|
5 '.tar.gz': ('application/x-gzip', 'tgz', ''), |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
6 '.zip': ('application/zip', 'zip', ''), |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
7 } |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
8 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
9 |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
10 class TestFilesController(TestController): |
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 |
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 def test_index(self): |
473
6b934c9607e7
Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
13 self.log_user() |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
14 response = self.app.get(url(controller='files', action='index', |
688
8acbfa837180
Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents:
547
diff
changeset
|
15 repo_name=HG_REPO, |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
16 revision='tip', |
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
17 f_path='/')) |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 # Test response... |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
19 response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
20 response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
21 response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
22 response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
23 response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>') |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
24 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
25 def test_index_revision(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
26 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
27 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
28 response = self.app.get( |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
29 url(controller='files', action='index', |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
30 repo_name=HG_REPO, |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
31 revision='7ba66bec8d6dbba14a2155be32408c435c5f4492', |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
32 f_path='/') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
33 ) |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
34 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
35 #Test response... |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
36 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
37 response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
38 response.mustcontain('<a class="browser-dir ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
39 response.mustcontain('<a class="browser-file ypjax-link" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
40 response.mustcontain('1.1 KiB') |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
41 response.mustcontain('text/x-python') |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
42 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
43 def test_index_different_branch(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
44 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
45 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
46 response = self.app.get(url(controller='files', action='index', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
47 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
48 revision='97e8b885c04894463c51898e14387d80c30ed1ee', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
49 f_path='/')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
50 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
51 response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: git</a></span>""") |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
52 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
53 def test_index_paging(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
54 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
55 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
56 for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
57 (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
58 (109, '75feb4c33e81186c87eac740cee2447330288412'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
59 (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
60 (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]: |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
61 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
62 response = self.app.get(url(controller='files', action='index', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
63 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
64 revision=r[1], |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
65 f_path='/')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
66 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
67 response.mustcontain("""@ r%s:%s""" % (r[0], r[1][:12])) |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
68 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
69 def test_file_source(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
70 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
71 response = self.app.get(url(controller='files', action='index', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
72 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
73 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
74 f_path='vcs/nodes.py')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
75 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
76 #test or history |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
77 response.mustcontain("""<optgroup label="Changesets"> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
78 <option value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
79 <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
80 <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
81 <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
82 <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf (git)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
83 <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
84 <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
85 <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
86 <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
87 <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
88 <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2 (git)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
89 <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
90 <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
91 <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
92 <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
93 <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
94 <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
95 <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
96 <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
97 <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
98 <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
99 <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
100 <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
101 <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
102 <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
103 <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
104 <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
105 <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
106 <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
107 <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
108 <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
109 <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
110 <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3 (default)</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
111 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
112 <optgroup label="Branches"> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
113 <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
114 <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
115 <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
116 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
117 <optgroup label="Tags"> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
118 <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
119 <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
120 <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
121 <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
122 <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
123 </optgroup> |
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
124 """) |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
125 |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
126 response.mustcontain("""<div class="commit">merge</div>""") |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
127 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
128 response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
129 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
130 def test_file_annotation(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
131 self.log_user() |
2180
c2d3cb1fdbde
fixed annotate tests
Marcin Kuzminski <marcin@python-works.com>
parents:
2085
diff
changeset
|
132 response = self.app.get(url(controller='files', action='index', |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
133 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
134 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
2180
c2d3cb1fdbde
fixed annotate tests
Marcin Kuzminski <marcin@python-works.com>
parents:
2085
diff
changeset
|
135 f_path='vcs/nodes.py', |
c2d3cb1fdbde
fixed annotate tests
Marcin Kuzminski <marcin@python-works.com>
parents:
2085
diff
changeset
|
136 annotate=True)) |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
137 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
138 |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
139 response.mustcontain("""<optgroup label="Changesets"> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
140 <option value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776 (default)</option> |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
141 <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
142 <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
143 <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
144 <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf (git)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
145 <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
146 <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
147 <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
148 <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
149 <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
150 <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2 (git)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
151 <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
152 <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
153 <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
154 <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
155 <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
156 <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
157 <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
158 <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
159 <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
160 <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
161 <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
162 <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
163 <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
164 <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
165 <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4 (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
166 <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
167 <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c (web)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
168 <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
169 <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
170 <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
171 <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6 (default)</option> |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
172 <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3 (default)</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
173 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
174 <optgroup label="Branches"> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
175 <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
176 <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
177 <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
178 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
179 <optgroup label="Tags"> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
180 <option selected="selected" value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
181 <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
182 <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
183 <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
184 <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
2085
2678b1e0e059
fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents:
1984
diff
changeset
|
185 </optgroup>""") |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
186 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
187 response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""") |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
188 |
2451
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
189 def test_file_annotation_git(self): |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
190 self.log_user() |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
191 response = self.app.get(url(controller='files', action='index', |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
192 repo_name=GIT_REPO, |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
193 revision='master', |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
194 f_path='vcs/nodes.py', |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
195 annotate=True)) |
402a96fcfa22
Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents:
2367
diff
changeset
|
196 |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
197 def test_archival(self): |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
198 self.log_user() |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
199 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
200 for arch_ext, info in ARCHIVE_SPECS.items(): |
2277
bb0309b4e1ee
fixed tests, and archival method
Marcin Kuzminski <marcin@python-works.com>
parents:
2255
diff
changeset
|
201 short = '27cd5cce30c9%s' % arch_ext |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
202 fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext |
2277
bb0309b4e1ee
fixed tests, and archival method
Marcin Kuzminski <marcin@python-works.com>
parents:
2255
diff
changeset
|
203 filename = '%s-%s' % (HG_REPO, short) |
2289
5893414dea91
renamed setup module into a setup_rhodecode.
Marcin Kuzminski <marcin@python-works.com>
parents:
2277
diff
changeset
|
204 response = self.app.get(url(controller='files', |
2277
bb0309b4e1ee
fixed tests, and archival method
Marcin Kuzminski <marcin@python-works.com>
parents:
2255
diff
changeset
|
205 action='archivefile', |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
206 repo_name=HG_REPO, |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
207 fname=fname)) |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
208 |
2255
95800dad44d0
fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2180
diff
changeset
|
209 self.assertEqual(response.status, '200 OK') |
2294
3c1d991755df
Use paste fileapp to properly send the archive size
Marcin Kuzminski <marcin@python-works.com>
parents:
2289
diff
changeset
|
210 heads = [ |
2367
86aa4f1f130b
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2318
diff
changeset
|
211 ('Pragma', 'no-cache'), |
86aa4f1f130b
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2318
diff
changeset
|
212 ('Cache-Control', 'no-cache'), |
2318
058e2743e7b7
fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2294
diff
changeset
|
213 ('Content-Disposition', 'attachment; filename=%s' % filename), |
058e2743e7b7
fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2294
diff
changeset
|
214 ('Content-Type', '%s; charset=utf-8' % info[0]), |
2294
3c1d991755df
Use paste fileapp to properly send the archive size
Marcin Kuzminski <marcin@python-works.com>
parents:
2289
diff
changeset
|
215 ] |
3c1d991755df
Use paste fileapp to properly send the archive size
Marcin Kuzminski <marcin@python-works.com>
parents:
2289
diff
changeset
|
216 self.assertEqual(response.response._headers.items(), heads) |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
217 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
218 def test_archival_wrong_ext(self): |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
219 self.log_user() |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
220 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
221 for arch_ext in ['tar', 'rar', 'x', '..ax', '.zipz']: |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
222 fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
223 |
2367
86aa4f1f130b
white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2318
diff
changeset
|
224 response = self.app.get(url(controller='files', |
2318
058e2743e7b7
fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2294
diff
changeset
|
225 action='archivefile', |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
226 repo_name=HG_REPO, |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
227 fname=fname)) |
2255
95800dad44d0
fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2180
diff
changeset
|
228 response.mustcontain('Unknown archive type') |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
229 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
230 def test_archival_wrong_revision(self): |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
231 self.log_user() |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
232 |
2318
058e2743e7b7
fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2294
diff
changeset
|
233 for rev in ['00x000000', 'tar', 'wrong', '@##$@$42413232', '232dffcd']: |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
234 fname = '%s.zip' % rev |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
235 |
2318
058e2743e7b7
fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2294
diff
changeset
|
236 response = self.app.get(url(controller='files', |
058e2743e7b7
fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2294
diff
changeset
|
237 action='archivefile', |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
238 repo_name=HG_REPO, |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
239 fname=fname)) |
2255
95800dad44d0
fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2180
diff
changeset
|
240 response.mustcontain('Unknown revision') |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
241 |
1047 | 242 #========================================================================== |
243 # RAW FILE | |
244 #========================================================================== | |
245 def test_raw_file_ok(self): | |
246 self.log_user() | |
247 response = self.app.get(url(controller='files', action='rawfile', | |
248 repo_name=HG_REPO, | |
249 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
250 f_path='vcs/nodes.py')) | |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
251 |
2255
95800dad44d0
fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2180
diff
changeset
|
252 self.assertEqual(response.content_disposition, "attachment; filename=nodes.py") |
95800dad44d0
fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2180
diff
changeset
|
253 self.assertEqual(response.content_type, "text/x-python") |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
254 |
1047 | 255 def test_raw_file_wrong_cs(self): |
256 self.log_user() | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
257 rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc' |
1047 | 258 f_path = 'vcs/nodes.py' |
259 | |
260 response = self.app.get(url(controller='files', action='rawfile', | |
261 repo_name=HG_REPO, | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
262 revision=rev, |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
263 f_path=f_path)) |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
264 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
265 msg = """Revision %r does not exist for this repository""" % (rev) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
266 self.checkSessionFlash(response, msg) |
1047 | 267 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
268 msg = """%s""" % (HG_REPO) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
269 self.checkSessionFlash(response, msg) |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
270 |
1047 | 271 def test_raw_file_wrong_f_path(self): |
272 self.log_user() | |
273 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
274 f_path = 'vcs/ERRORnodes.py' | |
275 response = self.app.get(url(controller='files', action='rawfile', | |
276 repo_name=HG_REPO, | |
277 revision=rev, | |
278 f_path=f_path)) | |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
279 |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
280 msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
281 self.checkSessionFlash(response, msg) |
1047 | 282 |
283 #========================================================================== | |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
284 # RAW RESPONSE - PLAIN |
1047 | 285 #========================================================================== |
286 def test_raw_ok(self): | |
287 self.log_user() | |
288 response = self.app.get(url(controller='files', action='raw', | |
289 repo_name=HG_REPO, | |
290 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
291 f_path='vcs/nodes.py')) | |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
292 |
2255
95800dad44d0
fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents:
2180
diff
changeset
|
293 self.assertEqual(response.content_type, "text/plain") |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
294 |
1047 | 295 def test_raw_wrong_cs(self): |
296 self.log_user() | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
297 rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' |
1047 | 298 f_path = 'vcs/nodes.py' |
299 | |
300 response = self.app.get(url(controller='files', action='raw', | |
301 repo_name=HG_REPO, | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
302 revision=rev, |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
303 f_path=f_path)) |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
304 msg = """Revision %r does not exist for this repository""" % (rev) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
305 self.checkSessionFlash(response, msg) |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
306 |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
307 msg = """%s""" % (HG_REPO) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
308 self.checkSessionFlash(response, msg) |
1047 | 309 |
310 def test_raw_wrong_f_path(self): | |
311 self.log_user() | |
312 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
313 f_path = 'vcs/ERRORnodes.py' | |
314 response = self.app.get(url(controller='files', action='raw', | |
315 repo_name=HG_REPO, | |
316 revision=rev, | |
317 f_path=f_path)) | |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
318 msg = "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
319 self.checkSessionFlash(response, msg) |
1749
8ecc6b8229a5
commit less models
Marcin Kuzminski <marcin@python-works.com>
parents:
1737
diff
changeset
|
320 |
8ecc6b8229a5
commit less models
Marcin Kuzminski <marcin@python-works.com>
parents:
1737
diff
changeset
|
321 def test_ajaxed_files_list(self): |
8ecc6b8229a5
commit less models
Marcin Kuzminski <marcin@python-works.com>
parents:
1737
diff
changeset
|
322 self.log_user() |
1818
cf51bbfb120e
auto white-space removal
Marcin Kuzminski <marcin@python-works.com>
parents:
1749
diff
changeset
|
323 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' |
1984
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
324 response = self.app.get( |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
325 url('files_nodelist_home', repo_name=HG_REPO,f_path='/',revision=rev), |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
326 extra_environ={'HTTP_X_PARTIAL_XHR': '1'}, |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
327 ) |
ed3b20284830
fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents:
1818
diff
changeset
|
328 response.mustcontain("vcs/web/simplevcs/views/repository.py") |