Exemplo n.º 1
0
 def test_Discard_AssertThatCorrectParamaterGetPassedToShell(
         self, shell_mock):
     revision1 = "anyRevision"
     revision2 = "anyOtherRevision"
     anyurl = "anyUrl"
     config = self.configBuilder.setrepourl(anyurl).setworkspace(
         self.workspace).build()
     Changes.discard(config, self.createChangeEntry(revision1),
                     self.createChangeEntry(revision2))
     expected_discard_command = "lscm discard -w %s -r %s -o %s %s" % (
         self.workspace, anyurl, revision1, revision2)
     shell_mock.execute.assert_called_once_with(expected_discard_command)
Exemplo n.º 2
0
 def test_Discard_AssertThatChangeEntriesGetUnAccepted(self):
     with patch.object(shell, 'execute', return_value=0) as shell_mock:
         revision1 = "anyRevision"
         revision2 = "anyOtherRevision"
         anyurl = "anyUrl"
         config = self.configBuilder.setrepourl(anyurl).setworkspace(
             self.workspace).build()
         configuration.config = config
         changeentry1 = testhelper.createchangeentry(revision1)
         changeentry1.setAccepted()
         changeentry2 = testhelper.createchangeentry(revision2)
         changeentry2.setAccepted()
         Changes.discard(changeentry1, changeentry2)
         self.assertFalse(changeentry1.isAccepted())
         self.assertFalse(changeentry2.isAccepted())