Mercurial > python-hglib
comparison tests/test-commit.py @ 201:67398bbf788d 2.6
client: do not accept NULL character as command arguments
It would break the data structure, and it's also invalid as a shell command.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 25 Apr 2018 21:27:02 +0900 |
parents | c1b966866ed7 |
children |
comparison
equal
deleted
inserted
replaced
200:7da1dad166b5 | 201:67398bbf788d |
---|---|
58 self.append('a', 'a') | 58 self.append('a', 'a') |
59 rev1, node1 = self.client.commit(amend=True) | 59 rev1, node1 = self.client.commit(amend=True) |
60 self.assertEquals(now, self.client.tip().date) | 60 self.assertEquals(now, self.client.tip().date) |
61 self.assertNotEquals(node0, node1) | 61 self.assertNotEquals(node0, node1) |
62 self.assertEqual(1, len(self.client.log())) | 62 self.assertEqual(1, len(self.client.log())) |
63 | |
64 def test_nul_injection(self): | |
65 self.append('a', 'a') | |
66 self.assertRaises(ValueError, lambda: self.client.commit(b('fail\0-A'))) | |
67 self.assertEqual(0, len(self.client.log())) |