def test_archive_with_directories(self, mock_path, mock_rmtree, mock_os, mock_call): mock_os.listdir.return_value = ['123123123', '234234234'] mock_path.isdir.return_value = True backup = Backup(config) backup.archive() self.assertTrue(mock_os.listdir.called) self.assertTrue(mock_call.called) self.assertTrue(mock_rmtree.called)
def test_archive_without_directories(self, mock_path, mock_rmtree, mock_os, mock_call): backup = Backup(config) backup.archive() self.assertTrue(mock_os.listdir.called) self.assertFalse(mock_call.called) self.assertFalse(mock_rmtree.called)