Exemple #1
0
 def test_edit(self):
     bts = self.bts
     bts.txbuffer.clear()
     c = Comment(self.authorperm, hive_instance=bts)
     c.edit(c.body, replace=False)
     body = c.body + "test"
     tx = c.edit(body, replace=False)
     self.assertEqual((tx["operations"][0][0]), "comment")
     op = tx["operations"][0][1]
     self.assertIn(self.author, op["author"])
Exemple #2
0
 def test_edit_replace(self):
     bts = self.bts
     bts.txbuffer.clear()
     c = Comment(self.authorperm, hive_instance=bts)
     body = c.body + "test"
     tx = c.edit(body, meta=c["json_metadata"], replace=True)
     self.assertEqual((tx["operations"][0][0]), "comment")
     op = tx["operations"][0][1]
     self.assertIn(self.author, op["author"])
     self.assertEqual(body, op["body"])