Changeset - bbddef1e9ef2
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-02-19 00:49:08
marcin@python-works.com
fixes and extends file tests
1 file changed with 20 insertions and 12 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_files.py
Show inline comments
 
@@ -246,20 +246,22 @@ removed extra unicode conversion in diff
 
                                    repo_name=HG_REPO,
 
                                    revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
 
                                    f_path='vcs/nodes.py'))
 
        assert False
 
        #print response.body()
 
        #assert False
 
        #TODO: put in more
 

	
 
    def test_raw_file_wrong_cs(self):
 
        self.log_user()
 
        rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc'
 
        rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc'
 
        f_path = 'vcs/nodes.py'
 

	
 
        response = self.app.get(url(controller='files', action='rawfile',
 
                                    repo_name=HG_REPO,
 
                                    revision='ERRORce30c96924232dffcd24178a07ffeb5dfc',
 
                                    revision=rev,
 
                                    f_path='vcs/nodes.py'))
 
        print response.session['flash']
 
        assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0], 'No flash message'
 
        assert """%s""" % (HG_REPO) in response.session['flash'][0], 'No flash message'
 

	
 
        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'
 

	
 

	
 

	
 
@@ -271,7 +273,7 @@ removed extra unicode conversion in diff
 
                                    repo_name=HG_REPO,
 
                                    revision=rev,
 
                                    f_path=f_path))
 
        assert "There is no file nor directory at the given path %r at revision %r" % (f_path, rev) in response.session['flash'][0], 'No flash message'
 
        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
 
@@ -282,18 +284,23 @@ removed extra unicode conversion in diff
 
                                    repo_name=HG_REPO,
 
                                    revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
 
                                    f_path='vcs/nodes.py'))
 
        assert False
 
        #assert False
 
        #TODO: put in more
 

	
 
    def test_raw_wrong_cs(self):
 
        self.log_user()
 
        rev = 'ERRORcce30c96924232dffcd24178a07ffeb5dfc'
 
        rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc'
 
        f_path = 'vcs/nodes.py'
 

	
 
        response = self.app.get(url(controller='files', action='raw',
 
                                    repo_name=HG_REPO,
 
                                    revision='ERRORce30c96924232dffcd24178a07ffeb5dfc',
 
                                    revision=rev,
 
                                    f_path='vcs/nodes.py'))
 
        assert "Cannot find revision %s" % rev in response.session['flash'][0], 'No flash message'
 

	
 
        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'
 

	
 

	
 
    def test_raw_wrong_f_path(self):
 
        self.log_user()
 
@@ -303,5 +310,6 @@ removed extra unicode conversion in diff
 
                                    repo_name=HG_REPO,
 
                                    revision=rev,
 
                                    f_path=f_path))
 
        assert "There is no file nor directory at the given path %r at revision %r" % (f_path, rev) in response.session['flash'][0], 'No flash message'
 

	
 
        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'
 

	
0 comments (0 inline, 0 general)