Mercurial > kallithea
annotate rhodecode/tests/functional/test_files.py @ 1548:cba42a9e9164 beta
fixed tests for new vcs localtime changes
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 12 Oct 2011 00:29:13 +0200 |
parents | 6832ef664673 |
children | 5ca2a5e96793 |
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 |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
9 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
|
10 |
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
11 def test_index(self): |
473
6b934c9607e7
Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
12 self.log_user() |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
13 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
|
14 repo_name=HG_REPO, |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
15 revision='tip', |
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
16 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
|
17 # Test response... |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
18 assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/docs">docs</a>' in response.body, 'missing dir' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
19 assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/tests">tests</a>' in response.body, 'missing dir' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
20 assert '<a class="browser-dir" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/vcs">vcs</a>' in response.body, 'missing dir' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
21 assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/.hgignore">.hgignore</a>' in response.body, 'missing file' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
22 assert '<a class="browser-file" href="/vcs_test_hg/files/27cd5cce30c96924232dffcd24178a07ffeb5dfc/MANIFEST.in">MANIFEST.in</a>' in response.body, 'missing file' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
23 |
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 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
28 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
|
29 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
30 revision='7ba66bec8d6dbba14a2155be32408c435c5f4492', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
31 f_path='/')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
32 |
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 |
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 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
37 assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/docs">docs</a>' in response.body, 'missing dir' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
38 assert '<a class="browser-dir" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/tests">tests</a>' in response.body, 'missing dir' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
39 assert '<a class="browser-file" href="/vcs_test_hg/files/7ba66bec8d6dbba14a2155be32408c435c5f4492/README.rst">README.rst</a>' in response.body, 'missing file' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
40 assert '1.1 KiB' in response.body, 'missing size of setup.py' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
41 assert 'text/x-python' in response.body, 'missing mimetype of setup.py' |
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 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
44 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
45 def test_index_different_branch(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
46 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
47 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
48 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
|
49 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
50 revision='97e8b885c04894463c51898e14387d80c30ed1ee', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
51 f_path='/')) |
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 |
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 assert """<span style="text-transform: uppercase;"><a href="#">branch: git</a></span>""" in response.body, 'missing or wrong branch info' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
56 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
57 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
58 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
59 def test_index_paging(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
60 self.log_user() |
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 for r in [(73, 'a066b25d5df7016b45a41b7e2a78c33b57adc235'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
63 (92, 'cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
64 (109, '75feb4c33e81186c87eac740cee2447330288412'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
65 (1, '3d8f361e72ab303da48d799ff1ac40d5ac37c67e'), |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
66 (0, 'b986218ba1c9b0d6a259fac9b050b1724ed8e545')]: |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
67 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
68 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
|
69 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
70 revision=r[1], |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
71 f_path='/')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
72 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
73 assert """@ r%s:%s""" % (r[0], r[1][:12]) in response.body, 'missing info about current revision' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
74 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
75 def test_file_source(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
76 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
77 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
|
78 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
79 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
80 f_path='vcs/nodes.py')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
81 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
82 #test or history |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
83 assert """<optgroup label="Changesets"> |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
84 <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
85 <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
86 <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
87 <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
88 <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
89 <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
90 <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
91 <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
92 <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
93 <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
94 <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
95 <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
96 <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
97 <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
98 <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
99 <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
100 <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
101 <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
102 <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
103 <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
104 <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
105 <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
106 <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
107 <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
108 <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
109 <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
110 <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
111 <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
112 <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
113 <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
114 <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
115 <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
116 <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
117 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
118 <optgroup label="Branches"> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
119 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
120 <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
121 <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
122 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
123 <optgroup label="Tags"> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
124 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
125 <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
126 <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
127 <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
128 <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
129 </optgroup>""" in response.body |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
130 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
131 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
132 assert """<div class="commit">"Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
133 In addition some other __str__ are unicode as well |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
134 Added test for unicode |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
135 Improved test to clone into uniq repository. |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
136 removed extra unicode conversion in diff."</div>""" in response.body |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
137 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
138 assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info' |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
139 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
140 def test_file_annotation(self): |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
141 self.log_user() |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
142 response = self.app.get(url(controller='files', action='annotate', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
143 repo_name=HG_REPO, |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
144 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
145 f_path='vcs/nodes.py')) |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
146 |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
147 print response.body |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
148 assert """<optgroup label="Changesets"> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
149 <option selected="selected" value="8911406ad776fdd3d0b9932a2e89677e57405a48">r167:8911406ad776</option> |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
150 <option value="aa957ed78c35a1541f508d2ec90e501b0a9e3167">r165:aa957ed78c35</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
151 <option value="48e11b73e94c0db33e736eaeea692f990cb0b5f1">r140:48e11b73e94c</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
152 <option value="adf3cbf483298563b968a6c673cd5bde5f7d5eea">r126:adf3cbf48329</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
153 <option value="6249fd0fb2cfb1411e764129f598e2cf0de79a6f">r113:6249fd0fb2cf</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
154 <option value="75feb4c33e81186c87eac740cee2447330288412">r109:75feb4c33e81</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
155 <option value="9a4dc232ecdc763ef2e98ae2238cfcbba4f6ad8d">r108:9a4dc232ecdc</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
156 <option value="595cce4efa21fda2f2e4eeb4fe5f2a6befe6fa2d">r107:595cce4efa21</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
157 <option value="4a8bd421fbc2dfbfb70d85a3fe064075ab2c49da">r104:4a8bd421fbc2</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
158 <option value="57be63fc8f85e65a0106a53187f7316f8c487ffa">r102:57be63fc8f85</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
159 <option value="5530bd87f7e2e124a64d07cb2654c997682128be">r101:5530bd87f7e2</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
160 <option value="e516008b1c93f142263dc4b7961787cbad654ce1">r99:e516008b1c93</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
161 <option value="41f43fc74b8b285984554532eb105ac3be5c434f">r93:41f43fc74b8b</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
162 <option value="cc66b61b8455b264a7a8a2d8ddc80fcfc58c221e">r92:cc66b61b8455</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
163 <option value="73ab5b616b3271b0518682fb4988ce421de8099f">r91:73ab5b616b32</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
164 <option value="e0da75f308c0f18f98e9ce6257626009fdda2b39">r82:e0da75f308c0</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
165 <option value="fb2e41e0f0810be4d7103bc2a4c7be16ee3ec611">r81:fb2e41e0f081</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
166 <option value="602ae2f5e7ade70b3b66a58cdd9e3e613dc8a028">r76:602ae2f5e7ad</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
167 <option value="a066b25d5df7016b45a41b7e2a78c33b57adc235">r73:a066b25d5df7</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
168 <option value="637a933c905958ce5151f154147c25c1c7b68832">r61:637a933c9059</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
169 <option value="0c21004effeb8ce2d2d5b4a8baf6afa8394b6fbc">r60:0c21004effeb</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
170 <option value="a1f39c56d3f1d52d5fb5920370a2a2716cd9a444">r59:a1f39c56d3f1</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
171 <option value="97d32df05c715a3bbf936bf3cc4e32fb77fe1a7f">r58:97d32df05c71</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
172 <option value="08eaf14517718dccea4b67755a93368341aca919">r57:08eaf1451771</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
173 <option value="22f71ad265265a53238359c883aa976e725aa07d">r56:22f71ad26526</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
174 <option value="97501f02b7b4330924b647755663a2d90a5e638d">r49:97501f02b7b4</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
175 <option value="86ede6754f2b27309452bb11f997386ae01d0e5a">r47:86ede6754f2b</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
176 <option value="014c40c0203c423dc19ecf94644f7cac9d4cdce0">r45:014c40c0203c</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
177 <option value="ee87846a61c12153b51543bf860e1026c6d3dcba">r30:ee87846a61c1</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
178 <option value="9bb326a04ae5d98d437dece54be04f830cf1edd9">r26:9bb326a04ae5</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
179 <option value="536c1a19428381cfea92ac44985304f6a8049569">r24:536c1a194283</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
180 <option value="dc5d2c0661b61928834a785d3e64a3f80d3aad9c">r8:dc5d2c0661b6</option> |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
181 <option value="3803844fdbd3b711175fc3da9bdacfcd6d29a6fb">r7:3803844fdbd3</option> |
782
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
182 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
183 <optgroup label="Branches"> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
184 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">default</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
185 <option value="97e8b885c04894463c51898e14387d80c30ed1ee">git</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
186 <option value="2e6a2bf9356ca56df08807f4ad86d480da72a8f4">web</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
187 </optgroup> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
188 <optgroup label="Tags"> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
189 <option value="27cd5cce30c96924232dffcd24178a07ffeb5dfc">tip</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
190 <option value="fd4bdb5e9b2a29b4393a4ac6caef48c17ee1a200">0.1.4</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
191 <option value="17544fbfcd33ffb439e2b728b5d526b1ef30bfcf">0.1.3</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
192 <option value="a7e60bff65d57ac3a1a1ce3b12a70f8a9e8a7720">0.1.2</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
193 <option value="eb3a60fc964309c1a318b8dfe26aa2d1586c85ae">0.1.1</option> |
51127b2efb33
fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents:
734
diff
changeset
|
194 </optgroup>""" in response.body, 'missing or wrong history in annotation' |
729
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
195 |
942803947f67
added some tests for files
Marcin Kuzminski <marcin@python-works.com>
parents:
688
diff
changeset
|
196 assert """<span style="text-transform: uppercase;"><a href="#">branch: default</a></span>""" in response.body, 'missing or wrong branch info' |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
197 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
198 |
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 def test_archival(self): |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
201 self.log_user() |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
202 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
203 for arch_ext, info in ARCHIVE_SPECS.items(): |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
204 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
|
205 filename = '%s-%s' % (HG_REPO, fname) |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
206 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
207 response = self.app.get(url(controller='files', action='archivefile', |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
208 repo_name=HG_REPO, |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
209 fname=fname)) |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
210 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
211 assert response.status == '200 OK', 'wrong response code' |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
212 assert response.response._headers.items() == [('Pragma', 'no-cache'), |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
213 ('Cache-Control', 'no-cache'), |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
214 ('Content-Type', '%s; charset=utf-8' % info[0]), |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
215 ('Content-Disposition', 'attachment; filename=%s' % filename), ], 'wrong headers' |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
216 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
217 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
|
218 self.log_user() |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
219 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
220 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
|
221 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
|
222 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
223 response = self.app.get(url(controller='files', action='archivefile', |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
224 repo_name=HG_REPO, |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
225 fname=fname)) |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
226 assert 'Unknown archive type' in response.body |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
227 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
228 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
229 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
|
230 self.log_user() |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
231 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
232 for rev in ['00x000000', 'tar', 'wrong', '@##$@$424213232', '232dffcd']: |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
233 fname = '%s.zip' % rev |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
234 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
235 response = self.app.get(url(controller='files', action='archivefile', |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
236 repo_name=HG_REPO, |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
237 fname=fname)) |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
238 assert 'Unknown revision' in response.body |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
239 |
1047 | 240 #========================================================================== |
241 # RAW FILE | |
242 #========================================================================== | |
243 def test_raw_file_ok(self): | |
244 self.log_user() | |
245 response = self.app.get(url(controller='files', action='rawfile', | |
246 repo_name=HG_REPO, | |
247 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
248 f_path='vcs/nodes.py')) | |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
249 |
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
250 assert response.content_disposition == "attachment; filename=nodes.py" |
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
251 assert response.content_type == "text/x-python" |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
252 |
1047 | 253 def test_raw_file_wrong_cs(self): |
254 self.log_user() | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
255 rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc' |
1047 | 256 f_path = 'vcs/nodes.py' |
257 | |
258 response = self.app.get(url(controller='files', action='rawfile', | |
259 repo_name=HG_REPO, | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
260 revision=rev, |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
261 f_path=f_path)) |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
262 |
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
263 assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message' |
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
264 assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message' |
1047 | 265 |
873
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
266 |
386fe4ce5f97
Added tests for archival, cleaned changelog test from prints
Marcin Kuzminski <marcin@python-works.com>
parents:
782
diff
changeset
|
267 |
1047 | 268 def test_raw_file_wrong_f_path(self): |
269 self.log_user() | |
270 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
271 f_path = 'vcs/ERRORnodes.py' | |
272 response = self.app.get(url(controller='files', action='rawfile', | |
273 repo_name=HG_REPO, | |
274 revision=rev, | |
275 f_path=f_path)) | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
276 assert "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) in response.session['flash'][0][1], 'No flash message' |
1047 | 277 |
278 #========================================================================== | |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
279 # RAW RESPONSE - PLAIN |
1047 | 280 #========================================================================== |
281 def test_raw_ok(self): | |
282 self.log_user() | |
283 response = self.app.get(url(controller='files', action='raw', | |
284 repo_name=HG_REPO, | |
285 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
286 f_path='vcs/nodes.py')) | |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
287 |
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
288 assert response.content_type == "text/plain" |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
289 |
1047 | 290 def test_raw_wrong_cs(self): |
291 self.log_user() | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
292 rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' |
1047 | 293 f_path = 'vcs/nodes.py' |
294 | |
295 response = self.app.get(url(controller='files', action='raw', | |
296 repo_name=HG_REPO, | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
297 revision=rev, |
1064
113a8db22852
file tests updates + extended the feed tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1063
diff
changeset
|
298 f_path=f_path)) |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
299 |
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
300 assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message' |
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
301 assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message' |
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
302 |
1047 | 303 |
304 def test_raw_wrong_f_path(self): | |
305 self.log_user() | |
306 rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc' | |
307 f_path = 'vcs/ERRORnodes.py' | |
308 response = self.app.get(url(controller='files', action='raw', | |
309 repo_name=HG_REPO, | |
310 revision=rev, | |
311 f_path=f_path)) | |
312 | |
1063
bbddef1e9ef2
fixes and extends file tests
Marcin Kuzminski <marcin@python-works.com>
parents:
1047
diff
changeset
|
313 assert "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) in response.session['flash'][0][1], 'No flash message' |