Beispiel #1
0
	def __call__(self):

		if self.request.get('snippet-id'):
			sm = SnippetManager()
			snippetId = self.request.get('snippet-id')
			try:
				sm.deleteSnippet(snippetId)
				return True
			except KeyError:
				try:
					snippetId = re.sub(r'\W', '', self.request.get('snippet-id'))
					sm.deleteSnippet(snippetId)
				except KeyError:
					return False		
    def test_delete_snippet(self):
    	sm = SnippetManager()
    	sm.deleteSnippet('testDoc')

    	self.assertFalse('testDoc' in self.folder)