

class MockConferenceHolder:
    # This class is monkeypatched on top of the real conferenceholder
    _events = {}

    def __init__(self):
        pass

    @classmethod
    def add(cls, event):
        if event.id in cls._events:
            __tracebackhide__ = True
            raise Exception("Event '{}' already exists".format(event.id))
        cls._events[event.id] = event

    @classmethod
    def remove(cls, event):
        del cls._events[event.id]

    @classmethod
    def getById(cls, id_):
        return cls._events.get(id_)


class MockConference(object):
    def __repr__(self):
        return '<MockConference({})>'.format(self.id)

    def getId(self):
        return self.id



class MockConferenceHolder:
    # This class is monkeypatched on top of the real conferenceholder
    _events = {}

    def __init__(self):
        pass

    @classmethod
    def add(cls, event):
        if event.id in cls._events:
            __tracebackhide__ = True
            raise Exception("Event '{}' already exists".format(event.id))
        cls._events[int(event.id)] = event

    @classmethod
    def remove(cls, event):
        del cls._events[int(event.id)]

    @classmethod
    def getById(cls, id_, quiet=None):
        return cls._events.get(int(id_))


class MockConference(object):
    def __repr__(self):
        return '<MockConference({})>'.format(self.id)

    def getId(self):
        return self.id

Fix str/int usage in MockConferenceHolder
Fix str/int usage in MockConferenceHolder

  
  
  class MockConferenceHolder:
      # This class is monkeypatched on top of the real conferenceholder
      _events = {}
  
      def __init__(self):
          pass
  
      @classmethod
      def add(cls, event):
          if event.id in cls._events:
              __tracebackhide__ = True
              raise Exception("Event '{}' already exists".format(event.id))
-         cls._events[event.id] = event
+         cls._events[int(event.id)] = event
  
      @classmethod
      def remove(cls, event):
-         del cls._events[event.id]
+         del cls._events[int(event.id)]
  
      @classmethod
-     def getById(cls, id_):
+     def getById(cls, id_, quiet=None):
-         return cls._events.get(id_)
+         return cls._events.get(int(id_))
  
  
  class MockConference(object):
      def __repr__(self):
          return '<MockConference({})>'.format(self.id)
  
      def getId(self):
          return self.id
  
Fix str/int usage in MockConferenceHolder
## Code Before:


class MockConferenceHolder:
    # This class is monkeypatched on top of the real conferenceholder
    _events = {}

    def __init__(self):
        pass

    @classmethod
    def add(cls, event):
        if event.id in cls._events:
            __tracebackhide__ = True
            raise Exception("Event '{}' already exists".format(event.id))
        cls._events[event.id] = event

    @classmethod
    def remove(cls, event):
        del cls._events[event.id]

    @classmethod
    def getById(cls, id_):
        return cls._events.get(id_)


class MockConference(object):
    def __repr__(self):
        return '<MockConference({})>'.format(self.id)

    def getId(self):
        return self.id

## Instruction:
Fix str/int usage in MockConferenceHolder
## Code After:


class MockConferenceHolder:
    # This class is monkeypatched on top of the real conferenceholder
    _events = {}

    def __init__(self):
        pass

    @classmethod
    def add(cls, event):
        if event.id in cls._events:
            __tracebackhide__ = True
            raise Exception("Event '{}' already exists".format(event.id))
        cls._events[int(event.id)] = event

    @classmethod
    def remove(cls, event):
        del cls._events[int(event.id)]

    @classmethod
    def getById(cls, id_, quiet=None):
        return cls._events.get(int(id_))


class MockConference(object):
    def __repr__(self):
        return '<MockConference({})>'.format(self.id)

    def getId(self):
        return self.id
