annotate rhodecode/tests/functional/test_files.py @ 3574:000653f7cdf9 beta

avoid displaying repr of internal classes in user facing messages The context of the message will tell where the problem was and there is no reason to show ... does not exist for this repository <MercurialRepository at /home/marcink/repos/rhodecode>
author Mads Kiilerich <madski@unity3d.com>
date Thu, 21 Mar 2013 11:17:01 +0100
parents 6104dfd35b16
children ca7785fae354
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 473
diff changeset
1 from rhodecode.tests import *
3056
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
2 from rhodecode.model.db import Repository
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
3 from rhodecode.model.meta import Session
93
aec4c0071cb3 added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
5 ARCHIVE_SPECS = {
951
48896664e987 fixes for issue #104, code rewrites for vcs 0.2
Marcin Kuzminski <marcin@python-works.com>
parents: 873
diff changeset
6 '.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
7 '.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
8 '.zip': ('application/zip', 'zip', ''),
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
9 }
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
10
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
11
3056
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
12 def _set_downloads(repo_name, set_to):
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
13 repo = Repository.get_by_repo_name(repo_name)
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
14 repo.enable_downloads = set_to
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
15 Session().add(repo)
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
16 Session().commit()
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
17
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
18
93
aec4c0071cb3 added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 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
20
aec4c0071cb3 added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 def test_index(self):
473
6b934c9607e7 Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
22 self.log_user()
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 93
diff changeset
23 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
24 repo_name=HG_REPO,
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 93
diff changeset
25 revision='tip',
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 93
diff changeset
26 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
27 # Test response...
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
28 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
29 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
30 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
31 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
32 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
33
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
34 def test_index_revision(self):
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
35 self.log_user()
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 = self.app.get(
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
38 url(controller='files', action='index',
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
39 repo_name=HG_REPO,
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
40 revision='7ba66bec8d6dbba14a2155be32408c435c5f4492',
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
41 f_path='/')
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
42 )
729
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
43
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
44 #Test response...
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
45
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
46 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
47 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
48 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
49 response.mustcontain('1.1 KiB')
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
50 response.mustcontain('text/x-python')
729
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
51
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
52 def test_index_different_branch(self):
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
53 self.log_user()
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
54
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
55 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
56 repo_name=HG_REPO,
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
57 revision='97e8b885c04894463c51898e14387d80c30ed1ee',
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
58 f_path='/'))
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
59
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
60 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
61
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
62 def test_index_paging(self):
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
63 self.log_user()
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
64
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
65 for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'),
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
66 (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'),
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
67 (109, '75feb4c33e81186c87eac740cee2447330288412'),
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
68 (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'),
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
69 (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]:
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
70
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=r[1],
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
74 f_path='/'))
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
75
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
76 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
77
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
78 def test_file_source(self):
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
79 self.log_user()
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
80 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
81 repo_name=HG_REPO,
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
82 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
83 f_path='vcs/nodes.py'))
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
84
3009
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
85 response.mustcontain("""<div class="commit">Partially implemented <a class="issue-tracker-link" href="https://myissueserver.com/vcs_test_hg/issue/16">#16</a>. filecontent/commit message/author/node name are safe_unicode now.
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
86 In addition some other __str__ are unicode as well
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
87 Added test for unicode
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
88 Improved test to clone into uniq repository.
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
89 removed extra unicode conversion in diff.</div>
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
90 """)
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
91
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
92 response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""")
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
93
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
94 def test_file_source_history(self):
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
95 self.log_user()
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
96 response = self.app.get(url(controller='files', action='history',
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
97 repo_name=HG_REPO,
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
98 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
99 f_path='vcs/nodes.py'),
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
100 extra_environ={'HTTP_X_PARTIAL_XHR': '1'},)
729
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
101 #test or history
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
102 response.mustcontain("""<optgroup label="Changesets">
2947
01f5633ee68b fixed some tests after last iteration
Marcin Kuzminski <marcin@python-works.com>
parents: 2451
diff changeset
103 <option selected="selected" 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
104 <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
105 <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
106 <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
107 <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
108 <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
109 <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
110 <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
111 <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
112 <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
113 <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
114 <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
115 <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
116 <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
117 <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
118 <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
119 <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
120 <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
121 <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
122 <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
123 <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
124 <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
125 <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
126 <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
127 <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
128 <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
129 <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
130 <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
131 <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
132 <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
133 <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
134 <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
135 <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
136 </optgroup>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
137 <optgroup label="Branches">
2947
01f5633ee68b fixed some tests after last iteration
Marcin Kuzminski <marcin@python-works.com>
parents: 2451
diff changeset
138 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option>
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
139 <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
140 <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
141 </optgroup>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
142 <optgroup label="Tags">
2947
01f5633ee68b fixed some tests after last iteration
Marcin Kuzminski <marcin@python-works.com>
parents: 2451
diff changeset
143 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option>
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
144 <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
145 <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
146 <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
147 <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option>
2085
2678b1e0e059 fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1984
diff changeset
148 </optgroup>
2678b1e0e059 fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1984
diff changeset
149 """)
729
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
150
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
151 def test_file_annotation(self):
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
152 self.log_user()
2180
c2d3cb1fdbde fixed annotate tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2085
diff changeset
153 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
154 repo_name=HG_REPO,
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
155 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
2180
c2d3cb1fdbde fixed annotate tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2085
diff changeset
156 f_path='vcs/nodes.py',
c2d3cb1fdbde fixed annotate tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2085
diff changeset
157 annotate=True))
729
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
158
3009
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
159 response.mustcontain("""<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""")
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
160
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
161 def test_file_annotation_history(self):
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
162 self.log_user()
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
163 response = self.app.get(url(controller='files', action='history',
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
164 repo_name=HG_REPO,
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
165 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
166 f_path='vcs/nodes.py',
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
167 annotate=True),
f0e19116f154 fixed file history tests
Marcin Kuzminski <marcin@python-works.com>
parents: 2947
diff changeset
168 extra_environ={'HTTP_X_PARTIAL_XHR': '1'})
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
169
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
170 response.mustcontain("""<optgroup label="Changesets">
2947
01f5633ee68b fixed some tests after last iteration
Marcin Kuzminski <marcin@python-works.com>
parents: 2451
diff changeset
171 <option selected="selected" 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
172 <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
173 <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
174 <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
175 <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
176 <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
177 <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
178 <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
179 <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
180 <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
181 <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
182 <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
183 <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
184 <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
185 <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
186 <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
187 <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
188 <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
189 <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
190 <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
191 <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
192 <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
193 <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
194 <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
195 <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
196 <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
197 <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
198 <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
199 <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
200 <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
201 <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
202 <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
203 <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
204 </optgroup>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
205 <optgroup label="Branches">
2947
01f5633ee68b fixed some tests after last iteration
Marcin Kuzminski <marcin@python-works.com>
parents: 2451
diff changeset
206 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option>
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
207 <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
208 <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
209 </optgroup>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
210 <optgroup label="Tags">
2947
01f5633ee68b fixed some tests after last iteration
Marcin Kuzminski <marcin@python-works.com>
parents: 2451
diff changeset
211 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option>
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
212 <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
213 <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
214 <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option>
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 734
diff changeset
215 <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option>
2085
2678b1e0e059 fixed test after last fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1984
diff changeset
216 </optgroup>""")
729
942803947f67 added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
217
2451
402a96fcfa22 Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents: 2367
diff changeset
218 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
219 self.log_user()
402a96fcfa22 Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents: 2367
diff changeset
220 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
221 repo_name=GIT_REPO,
402a96fcfa22 Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents: 2367
diff changeset
222 revision='master',
402a96fcfa22 Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents: 2367
diff changeset
223 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
224 annotate=True))
402a96fcfa22 Added vcs testsuite for better integration tests + added fetching
Marcin Kuzminski <marcin@python-works.com>
parents: 2367
diff changeset
225
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
226 def test_archival(self):
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
227 self.log_user()
3056
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
228 _set_downloads(HG_REPO, set_to=True)
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
229 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
230 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
231 fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext
2277
bb0309b4e1ee fixed tests, and archival method
Marcin Kuzminski <marcin@python-works.com>
parents: 2255
diff changeset
232 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
233 response = self.app.get(url(controller='files',
2277
bb0309b4e1ee fixed tests, and archival method
Marcin Kuzminski <marcin@python-works.com>
parents: 2255
diff changeset
234 action='archivefile',
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
235 repo_name=HG_REPO,
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
236 fname=fname))
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
237
2255
95800dad44d0 fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2180
diff changeset
238 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
239 heads = [
2367
86aa4f1f130b white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2318
diff changeset
240 ('Pragma', 'no-cache'),
86aa4f1f130b white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2318
diff changeset
241 ('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
242 ('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
243 ('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
244 ]
3c1d991755df Use paste fileapp to properly send the archive size
Marcin Kuzminski <marcin@python-works.com>
parents: 2289
diff changeset
245 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
246
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
247 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
248 self.log_user()
3056
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
249 _set_downloads(HG_REPO, set_to=True)
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
250 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
251 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
252
2367
86aa4f1f130b white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2318
diff changeset
253 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
254 action='archivefile',
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
255 repo_name=HG_REPO,
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
256 fname=fname))
2255
95800dad44d0 fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2180
diff changeset
257 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
258
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
259 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
260 self.log_user()
3056
6104dfd35b16 Implemented #379 defaults settings page for creation of repositories
Marcin Kuzminski <marcin@python-works.com>
parents: 3009
diff changeset
261 _set_downloads(HG_REPO, set_to=True)
2318
058e2743e7b7 fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2294
diff changeset
262 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
263 fname = '%s.zip' % rev
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
264
2318
058e2743e7b7 fixes issue #455 Creating an archive generates an exception on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2294
diff changeset
265 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
266 action='archivefile',
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
267 repo_name=HG_REPO,
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
268 fname=fname))
2255
95800dad44d0 fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2180
diff changeset
269 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
270
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
271 #==========================================================================
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
272 # RAW FILE
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
273 #==========================================================================
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
274 def test_raw_file_ok(self):
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
275 self.log_user()
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
276 response = self.app.get(url(controller='files', action='rawfile',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
277 repo_name=HG_REPO,
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
278 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
279 f_path='vcs/nodes.py'))
1064
113a8db22852 file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1063
diff changeset
280
2255
95800dad44d0 fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2180
diff changeset
281 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
282 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
283
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
284 def test_raw_file_wrong_cs(self):
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
285 self.log_user()
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
286 rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc'
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
287 f_path = 'vcs/nodes.py'
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
288
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
289 response = self.app.get(url(controller='files', action='rawfile',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
290 repo_name=HG_REPO,
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
291 revision=rev,
1064
113a8db22852 file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1063
diff changeset
292 f_path=f_path))
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
293
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
294 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
295 self.checkSessionFlash(response, msg)
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
296
3574
000653f7cdf9 avoid displaying repr of internal classes in user facing messages
Mads Kiilerich <madski@unity3d.com>
parents: 3056
diff changeset
297 self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
873
386fe4ce5f97 Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
298
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
299 def test_raw_file_wrong_f_path(self):
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
300 self.log_user()
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
301 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
302 f_path = 'vcs/ERRORnodes.py'
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
303 response = self.app.get(url(controller='files', action='rawfile',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
304 repo_name=HG_REPO,
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
305 revision=rev,
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
306 f_path=f_path))
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
307
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
308 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
309 self.checkSessionFlash(response, msg)
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
310
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
311 #==========================================================================
1064
113a8db22852 file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1063
diff changeset
312 # RAW RESPONSE - PLAIN
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
313 #==========================================================================
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
314 def test_raw_ok(self):
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
315 self.log_user()
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
316 response = self.app.get(url(controller='files', action='raw',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
317 repo_name=HG_REPO,
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
318 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
319 f_path='vcs/nodes.py'))
1064
113a8db22852 file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1063
diff changeset
320
2255
95800dad44d0 fixes for tests on Windows
Marcin Kuzminski <marcin@python-works.com>
parents: 2180
diff changeset
321 self.assertEqual(response.content_type, "text/plain")
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
322
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
323 def test_raw_wrong_cs(self):
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
324 self.log_user()
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
325 rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc'
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
326 f_path = 'vcs/nodes.py'
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
327
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
328 response = self.app.get(url(controller='files', action='raw',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
329 repo_name=HG_REPO,
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
330 revision=rev,
1064
113a8db22852 file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1063
diff changeset
331 f_path=f_path))
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
332 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
333 self.checkSessionFlash(response, msg)
1063
bbddef1e9ef2 fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents: 1047
diff changeset
334
3574
000653f7cdf9 avoid displaying repr of internal classes in user facing messages
Mads Kiilerich <madski@unity3d.com>
parents: 3056
diff changeset
335 self.assertEqual('http://localhost/%s/files/tip/' % HG_REPO, response.headers['location'])
1047
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
336
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
337 def test_raw_wrong_f_path(self):
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
338 self.log_user()
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
339 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
340 f_path = 'vcs/ERRORnodes.py'
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
341 response = self.app.get(url(controller='files', action='raw',
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
342 repo_name=HG_REPO,
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
343 revision=rev,
15b60f83420c tests update
Marcin Kuzminski <marcin@python-works.com>
parents: 951
diff changeset
344 f_path=f_path))
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
345 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
346 self.checkSessionFlash(response, msg)
1749
8ecc6b8229a5 commit less models
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
347
8ecc6b8229a5 commit less models
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
348 def test_ajaxed_files_list(self):
8ecc6b8229a5 commit less models
Marcin Kuzminski <marcin@python-works.com>
parents: 1737
diff changeset
349 self.log_user()
1818
cf51bbfb120e auto white-space removal
Marcin Kuzminski <marcin@python-works.com>
parents: 1749
diff changeset
350 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
1984
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
351 response = self.app.get(
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
352 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
353 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
354 )
ed3b20284830 fixed tests after latest changes to history list
Marcin Kuzminski <marcin@python-works.com>
parents: 1818
diff changeset
355 response.mustcontain("vcs/web/simplevcs/views/repository.py")