コード例 #1
0
 def test_delete_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     assert comment.get(cid)
     ok = comment.delete(cid)
     assert ok
     assert not comment.get(cid)
     assert not comment.delete(cid), "Cannot delete twice same comment"
コード例 #2
0
ファイル: test_comment.py プロジェクト: leeccong/code
 def test_delete_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     assert comment.get(cid)
     ok = comment.delete(cid)
     assert ok
     assert not comment.get(cid)
     assert not comment.delete(cid), "Cannot delete twice same comment"
コード例 #3
0
ファイル: test_comment.py プロジェクト: leeccong/code
 def test_modify_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     comment.update(cid, {'content': 'new content'})
     assert comment.get(cid)[4] == 'new content'
コード例 #4
0
ファイル: test_comment.py プロジェクト: leeccong/code
 def test_get_unexisting_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     com = comment.get(cid + 1)
     assert com is None
コード例 #5
0
ファイル: test_comment.py プロジェクト: leeccong/code
 def test_chinese_comment(self):
     T_CONTENT_ZH = u'test is 牛B'
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT_ZH)
     com = comment.get(cid)
     assert com[4] == T_CONTENT_ZH
コード例 #6
0
ファイル: test_comment.py プロジェクト: leeccong/code
 def test_get_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     com = comment.get(cid)
     assert com[1] == T_PROJ_ID
     assert com[2] == T_REF
コード例 #7
0
 def test_modify_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     comment.update(cid, {'content': 'new content'})
     assert comment.get(cid)[4] == 'new content'
コード例 #8
0
 def test_get_unexisting_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     com = comment.get(cid + 1)
     assert com is None
コード例 #9
0
 def test_chinese_comment(self):
     T_CONTENT_ZH = 'test is 牛B'
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT_ZH)
     com = comment.get(cid)
     assert com[4] == T_CONTENT_ZH
コード例 #10
0
 def test_get_comment(self):
     cid = comment.add(T_PROJ_ID, T_REF, T_AUTHOR, T_CONTENT)
     com = comment.get(cid)
     assert com[1] == T_PROJ_ID
     assert com[2] == T_REF