def testAbortOfPermissionError(self):
    def _BuggyOpMethod(client, callback):
      self._method_count += 1
      # PermissionError is one of the exceptions which qualifies as abortable.
      raise PermissionError('Not Authorized')

    op = self._CreateTestOp(user_id=1, handler=_BuggyOpMethod)
    user_op_mgr = self._CreateUserOpManager(user_id=1, handlers=[_BuggyOpMethod], callback=self.stop)
    user_op_mgr.Execute()
    self.wait()
    self.assertEqual(self._method_count, 1)

    # Ensure that operation does not exist in the db.
    Operation.Query(self._client, 1, op.operation_id, None, lambda op: self.stop(op), must_exist=False)
    op = self.wait()
    self.assertTrue(op is None)
Calculates duration or track
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/test/op_manager_test.py/OpManagerTestCase.testAbortOfPermissionError--crossover with--dataset/ETHPy150Open tkrajina/gpxpy/gpxpy/gpx.py/GPXTrack.get_duration