Mercurial > python-hglib
diff tests/test-phase.py @ 126:a7fe976b1931
context: add 'phase' getter
This method must be dynamic as the phase can change during the lifetime of the
changeset.
author | Paul Tonelli <paul.tonelli@logilab.fr> |
---|---|
date | Wed, 21 May 2014 12:25:30 +0200 |
parents | 8d9a9da3e7b4 |
children | bcc8390d7819 |
line wrap: on
line diff
--- a/tests/test-phase.py Fri May 16 18:21:12 2014 +0200 +++ b/tests/test-phase.py Wed May 21 12:25:30 2014 +0200 @@ -7,25 +7,32 @@ self.append('a', 'a') rev, node0 = self.client.commit('first', addremove=True) self.assertEqual([(0, 'draft')], self.client.phase(node0)) + ctx = self.client[rev] + self.assertEqual('draft', ctx.phase()) def test_phase_public(self): - """phase change from draft to public""" + """test phase change from draft to public""" self.append('a', 'a') rev, node0 = self.client.commit('first', addremove=True) self.client.phase(node0, public=True) self.assertEqual([(0, 'public')], self.client.phase(node0)) + ctx = self.client[rev] + self.assertEqual('public', ctx.phase()) def test_phase_secret(self): - """phase change from draft to secret""" + """test phase change from draft to secret""" self.append('a', 'a') rev, node0 = self.client.commit('first', addremove=True) with self.assertRaises(hglib.error.CommandError): self.client.phase(node0, secret=True) self.client.phase(node0, secret=True, force=True) self.assertEqual([(0, 'secret')], self.client.phase(node0)) + ctx = self.client[rev] + self.assertEqual('secret', ctx.phase()) + def test_phase_multiple(self): - """phase changes and show the phases of the different changesets""" + """test phase changes and show the phases of the different changesets""" self.append('a', 'a') rev, node0 = self.client.commit('a', addremove=True) self.client.phase(node0, public=True)