def test_no_clean(self):
     tool = MockTool()
     tool._scm = Mock()
     step = CleanWorkingDirectory(tool, MockOptions(clean=False))
     step.run({})
     self.assertEqual(
         tool._scm.discard_working_directory_changes.call_count, 0)
 def test_run_working_directory_changes_force(self):
     tool = MockTool()
     tool._scm = Mock()
     step = CleanWorkingDirectory(tool, MockOptions(clean=True, force_clean=True))
     tool._scm.has_working_directory_changes = lambda: True
     step.run({})
     self.assertEqual(tool._scm.discard_working_directory_changes.call_count, 1)
Exemple #3
0
 def test_run_working_directory_changes_force(self):
     tool = MockTool()
     tool._scm = Mock()
     step = CleanWorkingDirectory(tool, MockOptions(clean=True, force_clean=True))
     tool._scm.has_working_directory_changes = lambda: True
     step.run({})
     self.assertEqual(tool._scm.discard_working_directory_changes.call_count, 1)
 def test_no_clean(self):
     tool = MockTool()
     tool._scm = Mock()
     step = CleanWorkingDirectory(tool, MockOptions(clean=False))
     step.run({})
     self.assertEqual(tool._scm.ensure_no_local_commits.call_count, 0)
     self.assertEqual(tool._scm.ensure_clean_working_directory.call_count, 0)
Exemple #5
0
 def test_no_clean(self):
     tool = MockTool()
     step = CleanWorkingDirectory(tool, MockOptions(clean=False))
     step.run({})
     self.assertEqual(tool._scm.ensure_no_local_commits.call_count, 0)
     self.assertEqual(tool._scm.ensure_clean_working_directory.call_count,
                      0)
 def test_run(self):
     tool = MockTool()
     tool._scm = Mock()
     tool._scm.checkout_root = '/mock-checkout'
     step = CleanWorkingDirectory(tool, MockOptions(clean=True, force_clean=False))
     step.run({})
     self.assertEqual(tool._scm.ensure_no_local_commits.call_count, 1)
     self.assertEqual(tool._scm.ensure_clean_working_directory.call_count, 1)
 def test_run(self):
     tool = MockTool()
     tool._scm = Mock()
     tool._scm.checkout_root = '/mock-checkout'
     step = CleanWorkingDirectory(
         tool, MockOptions(clean=True, force_clean=False))
     step.run({})
     self.assertEqual(tool._scm.ensure_no_local_commits.call_count, 1)
     self.assertEqual(tool._scm.ensure_clean_working_directory.call_count,
                      1)
 def test_no_clean(self):
     tool = MockTool()
     tool._scm = Mock()
     step = CleanWorkingDirectory(tool, MockOptions(clean=False))
     step.run({})
     self.assertEqual(tool._scm.discard_working_directory_changes.call_count, 0)