def test_commit(self): mercurial = Mercurial() with patch.object(mercurial, 'execute') as execute: mercurial.commit('message') execute.assert_called_with( ['hg', 'commit', '-A', '-m', 'message'.encode('utf8')])
def test_validate_ko_not_mercurial(self, workspace): mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: with pytest.raises(BumprError): mercurial.validate() assert execute.called is False
def test_tag_annotate(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, "execute") mercurial.tag("fake", annotation="some annotation") execute.assert_called_with( ["hg", "tag", "fake", "-m", '"some annotation"'])
def test_validate_ko_not_mercurial(self, workspace, mocker): mercurial = Mercurial() execute = mocker.patch('bumpr.vcs.execute') with pytest.raises(BumprError): mercurial.validate() assert execute.called is False
def test_tag_annotate(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, 'execute') mercurial.tag('fake', annotation='some annotation') execute.assert_called_with( ['hg', 'tag', 'fake', '-m', '"some annotation"'])
def test_validate_not_clean_dryrun(self, workspace, mocker): workspace.mkdir('.hg') mercurial = Mercurial() execute = mocker.patch('bumpr.vcs.execute') execute.return_value = '\n'.join((' M modified.py', '?? new.py')) mercurial.validate(dryrun=True) execute.assert_called_with('hg status -mard', verbose=False)
def test_validate_ok(self, workspace, mocker): workspace.mkdir(".hg") mercurial = Mercurial() execute = mocker.patch("bumpr.vcs.execute") execute.return_value = "?? new.py" mercurial.validate() execute.assert_called_with("hg status -mard", verbose=False)
def test_validate_not_clean_dryrun(self, workspace, mocker): workspace.mkdir(".hg") mercurial = Mercurial() execute = mocker.patch("bumpr.vcs.execute") execute.return_value = "\n".join((" M modified.py", "?? new.py")) mercurial.validate(dryrun=True) execute.assert_called_with("hg status -mard", verbose=False)
def test_validate_ok(self, workspace, mocker): workspace.mkdir('.hg') mercurial = Mercurial() execute = mocker.patch('bumpr.vcs.execute') execute.return_value = '?? new.py' mercurial.validate() execute.assert_called_with('hg status -mard', verbose=False)
def test_validate_ok(self, workspace): workspace.mkdir('.hg') mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: execute.return_value = '?? new.py' mercurial.validate() execute.assert_called_with('hg status -mard', verbose=False)
def test_validate_ko_not_mercurial(self): with workspace('mercurial'): mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: with self.assertRaises(BumprError): mercurial.validate() self.assertFalse(execute.called)
def test_validate_ko_not_mercurial(self): with workspace('mercurial') as wksp: mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: with self.assertRaises(BumprError): mercurial.validate() self.assertFalse(execute.called)
def test_validate_ok(self): with workspace('mercurial') as wksp: os.mkdir('.hg') mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: execute.return_value = '?? new.py' mercurial.validate() execute.assert_called_with('hg status -mard', verbose=False)
def test_validate_ko_not_clean(self, workspace): workspace.mkdir('.hg') mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: execute.return_value = '\n'.join((' M modified.py', '?? new.py')) with pytest.raises(BumprError): mercurial.validate() execute.assert_called_with('hg status -mard', verbose=False)
def test_validate_ko_not_clean(self): with workspace('mercurial') as wksp: os.mkdir('.hg') mercurial = Mercurial() with patch('bumpr.vcs.execute') as execute: execute.return_value = '\n'.join( (' M modified.py', '?? new.py')) with self.assertRaises(BumprError): mercurial.validate() execute.assert_called_with('hg status -mard', verbose=False)
def test_commit(self): mercurial = Mercurial() with patch.object(mercurial, 'execute') as execute: mercurial.commit('message') execute.assert_called_with(['hg', 'commit', '-A', '-m', 'message'])
def test_tag(self): mercurial = Mercurial() with patch.object(mercurial, 'execute') as execute: mercurial.tag('fake') execute.assert_called_with(['hg', 'tag', 'fake'])
def test_push(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, "execute") mercurial.push() execute.assert_called_with(["hg", "push"])
def test_commit(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, "execute") mercurial.commit("message") execute.assert_called_with(["hg", "commit", "-A", "-m", "message"])
def test_push(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, 'execute') mercurial.push() execute.assert_called_with(['hg', 'push'])
def test_commit(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, 'execute') mercurial.commit('message') execute.assert_called_with(['hg', 'commit', '-A', '-m', 'message'])
def test_tag(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, "execute") mercurial.tag("fake") execute.assert_called_with(["hg", "tag", "fake"])
def test_tag(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, 'execute') mercurial.tag('fake') execute.assert_called_with(['hg', 'tag', 'fake'])
def test_push(self): mercurial = Mercurial() with patch.object(mercurial, 'execute') as execute: mercurial.push() execute.assert_called_with(['hg', 'push'])
def test_tag_annotate(self, mocker): mercurial = Mercurial() execute = mocker.patch.object(mercurial, 'execute') mercurial.tag('fake', annotation='some annotation') execute.assert_called_with(['hg', 'tag', 'fake', '-m', '"some annotation"'])