Changeset - 113a8db22852
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2011-02-19 01:05:20
marcin@python-works.com
file tests updates + extended the feed tests
2 files changed with 17 insertions and 11 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_feed.py
Show inline comments
 
@@ -6,10 +6,17 @@ class TestFeedController(TestController)
 
        self.log_user()
 
        response = self.app.get(url(controller='feed', action='rss',
 
                                    repo_name=HG_REPO))
 
        # Test response...
 

	
 

	
 

	
 
        assert response.content_type == "application/rss+xml"
 
        assert """<rss version="2.0">""" in response
 

	
 
    def test_atom(self):
 
        self.log_user()
 
        response = self.app.get(url(controller='feed', action='atom',
 
                                    repo_name=HG_REPO))
 
        # Test response...
 
\ No newline at end of file
 

	
 
        assert response.content_type == """application/atom+xml"""
 
        assert """<?xml version="1.0" encoding="utf-8"?>""" in response
 
        assert """<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">""" in response
rhodecode/tests/functional/test_files.py
Show inline comments
 
@@ -246,9 +246,9 @@ removed extra unicode conversion in diff
 
                                    repo_name=HG_REPO,
 
                                    revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
 
                                    f_path='vcs/nodes.py'))
 
        #print response.body()
 
        #assert False
 
        #TODO: put in more
 

	
 
        assert response.content_disposition == "attachment; filename=nodes.py"
 
        assert response.content_type == "text/x-python"
 

	
 
    def test_raw_file_wrong_cs(self):
 
        self.log_user()
 
@@ -258,7 +258,7 @@ removed extra unicode conversion in diff
 
        response = self.app.get(url(controller='files', action='rawfile',
 
                                    repo_name=HG_REPO,
 
                                    revision=rev,
 
                                    f_path='vcs/nodes.py'))
 
                                    f_path=f_path))
 

	
 
        assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message'
 
        assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message'
 
@@ -276,7 +276,7 @@ removed extra unicode conversion in diff
 
        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'
 

	
 
    #==========================================================================
 
    # RAW
 
    # RAW RESPONSE - PLAIN
 
    #==========================================================================
 
    def test_raw_ok(self):
 
        self.log_user()
 
@@ -284,8 +284,8 @@ removed extra unicode conversion in diff
 
                                    repo_name=HG_REPO,
 
                                    revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
 
                                    f_path='vcs/nodes.py'))
 
        #assert False
 
        #TODO: put in more
 

	
 
        assert response.content_type == "text/plain"
 

	
 
    def test_raw_wrong_cs(self):
 
        self.log_user()
 
@@ -295,9 +295,8 @@ removed extra unicode conversion in diff
 
        response = self.app.get(url(controller='files', action='raw',
 
                                    repo_name=HG_REPO,
 
                                    revision=rev,
 
                                    f_path='vcs/nodes.py'))
 
                                    f_path=f_path))
 

	
 
        print response.session['flash'][0][1]
 
        assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message'
 
        assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message'
 

	
0 comments (0 inline, 0 general)