def test_validate_ko_not_bazaar(self, workspace): bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: with pytest.raises(BumprError): bazaar.validate() assert execute.called is False
def test_validate_ko_not_bazaar(self, workspace, mocker): bazaar = Bazaar() execute = mocker.patch('bumpr.vcs.execute') with pytest.raises(BumprError): bazaar.validate() assert execute.called is False
def test_validate_ok(self, workspace): workspace.mkdir('.bzr') bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: execute.return_value = '? new.py' bazaar.validate() execute.assert_called_with('bzr status --short', verbose=False)
def test_validate_ko_not_bazaar(self): with workspace('bazaar') as wksp: bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: with self.assertRaises(BumprError): bazaar.validate() self.assertFalse(execute.called)
def test_validate_ok(self, workspace, mocker): workspace.mkdir('.bzr') bazaar = Bazaar() execute = mocker.patch('bumpr.vcs.execute') execute.return_value = '? new.py' bazaar.validate() execute.assert_called_with('bzr status --short', verbose=False)
def test_validate_ko_not_bazaar(self): with workspace('bazaar'): bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: with self.assertRaises(BumprError): bazaar.validate() self.assertFalse(execute.called)
def test_validate_ok(self, workspace, mocker): workspace.mkdir(".bzr") bazaar = Bazaar() execute = mocker.patch("bumpr.vcs.execute") execute.return_value = "? new.py" bazaar.validate() execute.assert_called_with("bzr status --short", verbose=False)
def test_validate_ko_not_clean(self, workspace): workspace.mkdir('.bzr') bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: execute.return_value = '\n'.join((' M modified.py', '? new.py')) with pytest.raises(BumprError): bazaar.validate() execute.assert_called_with('bzr status --short', verbose=False)
def test_validate_ok(self): with workspace('bazaar') as wksp: os.mkdir('.bzr') bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: execute.return_value = '? new.py' bazaar.validate() execute.assert_called_with('bzr status --short', verbose=False)
def test_validate_ko_not_clean(self, workspace, mocker): workspace.mkdir('.bzr') bazaar = Bazaar() execute = mocker.patch('bumpr.vcs.execute') execute.return_value = '\n'.join((' M modified.py', '? new.py')) with pytest.raises(BumprError): bazaar.validate() execute.assert_called_with('bzr status --short', verbose=False)
def test_validate_ko_not_clean(self, workspace, mocker): workspace.mkdir(".bzr") bazaar = Bazaar() execute = mocker.patch("bumpr.vcs.execute") execute.return_value = "\n".join((" M modified.py", "? new.py")) with pytest.raises(BumprError): bazaar.validate() execute.assert_called_with("bzr status --short", verbose=False)
def test_validate_not_clean_dryrun(self, workspace, mocker): workspace.mkdir('.bzr') bazaar = Bazaar() execute = mocker.patch('bumpr.vcs.execute') execute.return_value = '\n'.join((' M modified.py', '? new.py')) bazaar.validate(dryrun=True) execute.assert_called_with('bzr status --short', verbose=False)
def test_validate_ko_not_clean(self): with workspace('bazaar') as wksp: os.mkdir('.bzr') bazaar = Bazaar() with patch('bumpr.vcs.execute') as execute: execute.return_value = '\n'.join( (' M modified.py', '? new.py')) with self.assertRaises(BumprError): bazaar.validate() execute.assert_called_with('bzr status --short', verbose=False)