Changeset 750:e25458e9bfb1 in hatta-dev for tests/test_repo.py


Ignore:
Timestamp:
01/25/10 15:16:53 (2 years ago)
Author:
sheep@…
Branch:
default
Message:

catch another corner case of subdriectory repo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/test_repo.py

    r747 r750  
    116116        assert not exists 
    117117 
     118    def test_create_parent(self, subdir_repo): 
     119        """ 
     120        Make sure you can't create a parent page of existsing page. 
     121        """ 
     122 
     123        subdir_repo.save_text(u'xxx/yyy', self.text, self.author, self.comment, 
     124                              parent=-1) 
     125        py.test.raises(werkzeug.exceptions.Forbidden, subdir_repo.save_text, 
     126                       u'xxx', self.text, self.author, self.comment, 
     127                       parent=-1) 
     128 
     129    def test_create_subpage(self, subdir_repo): 
     130        """ 
     131        Make sure you can't create a subpage of existsing page. 
     132        """ 
     133 
     134        subdir_repo.save_text(u'xxx', self.text, self.author, self.comment, 
     135                              parent=-1) 
     136        py.test.raises(werkzeug.exceptions.Forbidden, subdir_repo.save_text, 
     137                       u'xxx/yyy', self.text, self.author, self.comment, 
     138                       parent=-1) 
    118139 
    119140class TestMercurialStorage(object): 
     
    226247        py.test.raises(werkzeug.exceptions.Forbidden, repo.delete_page, 
    227248                       self.title, self.author, self.comment) 
     249 
    228250 
    229251class TestStorage(object): 
Note: See TracChangeset for help on using the changeset viewer.