paste* backends: Support the 'public' attribute
This commit is contained in:
parent
4b2b9e511f
commit
9022435e49
6 changed files with 27 additions and 4 deletions
|
|
@ -25,6 +25,9 @@ __all__ = ['PastealaconPaste']
|
|||
|
||||
|
||||
class PastealaconPaste(BasePaste):
|
||||
# all pastes are public
|
||||
public = True
|
||||
|
||||
@classmethod
|
||||
def id2url(cls, _id):
|
||||
return 'http://pastealacon.com/%s' % _id
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class PastealaconTest(BackendTest):
|
|||
assert p.title == 'ouiboube'
|
||||
assert p.page_url.startswith('http://pastealacon.com/')
|
||||
assert u'héhéhé' in p.contents
|
||||
assert p.public is True
|
||||
|
||||
# raw method
|
||||
p = self.backend.get_paste(_id)
|
||||
|
|
@ -41,6 +42,7 @@ class PastealaconTest(BackendTest):
|
|||
assert p.title is NotLoaded
|
||||
assert p.page_url.startswith('http://pastealacon.com/')
|
||||
assert u'héhéhé' in p.contents
|
||||
assert p.public is True
|
||||
|
||||
def test_post(self):
|
||||
p = self.backend.new_paste(None, title='ouiboube', contents=u'Weboob Test héhéhé')
|
||||
|
|
@ -49,6 +51,7 @@ class PastealaconTest(BackendTest):
|
|||
self.backend.fill_paste(p, ['title'])
|
||||
assert p.title == 'ouiboube'
|
||||
assert p.id in p.page_url
|
||||
assert p.public is True
|
||||
|
||||
# test all get methods from the Paste we just created
|
||||
self._get_paste(p.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue