annotate rhodecode/tests/functional/test_summary.py @ 1203:6832ef664673 beta

source code cleanup: remove trailing white space, normalize file endings
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 03 Apr 2011 18:23:15 +0200
parents c334e972f459
children 9c0f5d558789
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 *
1080
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
2 from rhodecode.model.db import Repository
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
3 from rhodecode.lib.utils import invalidate_cache
82
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
4
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
5 class TestSummaryController(TestController):
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
6
670713507d03 Moved summary to seperate controller,
Marcin Kuzminski <marcin@python-blog.com>
parents:
diff changeset
7 def test_index(self):
473
6b934c9607e7 Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
8 self.log_user()
688
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
9 response = self.app.get(url(controller='summary', action='index', repo_name=HG_REPO))
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
10
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
11 #repo type
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
12 assert """<img style="margin-bottom:2px" class="icon" title="Mercurial repository" alt="Mercurial repository" src="/images/icons/hgicon.png"/>""" in response.body
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
13 assert """<img style="margin-bottom:2px" class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>""" in response.body
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
14
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
15 #codes stats
1080
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
16
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
17
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
18 self._enable_stats()
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
19 invalidate_cache('get_repo_cached_%s' % HG_REPO)
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
20 response = self.app.get(url(controller='summary', action='index', repo_name=HG_REPO))
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
21 assert """var data = {"Python": 42, "Rst": 11, "Bash": 2, "Makefile": 1, "Batch": 1, "Ini": 1, "Css": 1};""" in response.body, 'wrong info about % of codes stats'
688
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
22
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
23 # clone url...
8acbfa837180 Tests rewrite for 1.2 added some globals configs to make tests easier.
Marcin Kuzminski <marcin@python-works.com>
parents: 567
diff changeset
24 assert """<input type="text" id="clone_url" readonly="readonly" value="hg clone http://test_admin@localhost:80/%s" size="70"/>""" % HG_REPO in response.body
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
25
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 688
diff changeset
26
1080
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
27 def _enable_stats(self):
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
28 r = Repository.by_repo_name(HG_REPO)
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
29 r.enable_statistics = True
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
30 self.sa.add(r)
c334e972f459 fixed summary tests
Marcin Kuzminski <marcin@python-works.com>
parents: 782
diff changeset
31 self.sa.commit()