def test_set_progress(self): # Setup mock_progress_callback = mock.MagicMock() # Test that the progress callback is called with the correct arguments export_utils.set_progress('id', 'status', mock_progress_callback) mock_progress_callback.assert_called_once_with('id', 'status')
def test_none_progress(self): # Test that if progress_callback is None, an exception isn't raised try: export_utils.set_progress('id', 'status', None) except AttributeError: self.fail('set_progress should not raise an AttributeError')