~dushyant37/+junk/ArchiverUI

« back to all changes in this revision

Viewing changes to ArchiverUI/archiverui/tests/functional/test_archives.py

  • Committer: Dushyant Bansal
  • Date: 2011-07-20 21:14:24 UTC
  • Revision ID: dushyant37@gmail.com-20110720211424-n0wnhyhkh0cvnmt3
Some fixes in search integration code. Started writing unit tests using nosetest and added support in environment for profiling with the help of repoze.profile

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from archiverui.tests import *
2
2
 
3
3
class TestArchivesController(TestController):
 
4
# No need for a different test.ini or modifying setup_app() in websetup.py as we are not modifying database
 
5
# file inside archiverUI. 
4
6
 
5
 
    def test_index(self):
6
 
        response = self.app.get(url(controller='archives', action='index'))
 
7
    def test_clist(self):
 
8
        response = self.app.get(url(controller='archives', action='clist', id=1))
 
9
        assert 'Test24' in response
7
10
        # Test response...
 
11
#        response.session: Session object
 
12
#        response.req: The Pylons request object based on the WebOb Request
 
13
#        response.c: The template context global containing variables passed to templates
 
14
#        response.g: The Pylons app globals object
 
15
#        response.response: The Pylons response global
 
16
    def test_404_invalid(self):
 
17
        # id is None
 
18
        response = self.app.get(
 
19
            url(controller='archives', action='clist', id=''),
 
20
            status = 404
 
21
        )
 
22
        
 
23
        # id is 0
 
24
        response = self.app.get(
 
25
            url(controller='archives', action='clist', id='0'),
 
26
            status = 404
 
27
        )
 
28
        
 
29
        # id is 'one'
 
30
        response = self.app.get(
 
31
            url(controller='archives', action='clist', id='one'),
 
32
            status = 404
 
33
        )
 
34
# Testing o    
 
 
b'\\ No newline at end of file'