code: def test_add(self):
      server, client = self._connected_pair()
  
      ep = select.epoll(2)
      try:
          ep.register(server.fileno(), select.EPOLLIN | select.EPOLLOUT)
          ep.register(client.fileno(), select.EPOLLIN | select.EPOLLOUT)
      finally:
          ep.close()
  
      # adding by object w/ fileno works, too.
      ep = select.epoll(2)
      try:
          ep.register(server, select.EPOLLIN | select.EPOLLOUT)
          ep.register(client, select.EPOLLIN | select.EPOLLOUT)
      finally:
          ep.close()
  
      ep = select.epoll(2)
      try:
          # TypeError: argument must be an int, or have a fileno() method.
          self.assertRaises(
              TypeError,
              ep.register,
              object(),
              select.EPOLLIN | select.EPOLLOUT,
          )
          self.assertRaises(
              TypeError,
              ep.register,
              None,
              select.EPOLLIN | select.EPOLLOUT,
          )
          # ValueError: file descriptor cannot be a negative integer (-1)
          self.assertRaises(
              ValueError,
              ep.register,
              -1,
              select.EPOLLIN | select.EPOLLOUT,
          )
          # OSError: [Errno 9] Bad file descriptor
          self.assertRaises(
              OSError,
              ep.register,
              10000,
              select.EPOLLIN | select.EPOLLOUT,
          )
          # registering twice also raises an exception
          ep.register(server, select.EPOLLIN | select.EPOLLOUT)
          self.assertRaises(
              OSError,
              ep.register,
              server,
              select.EPOLLIN | select.EPOLLOUT,
          )
      finally:
          ep.close()
  
imports: import errno
  import os
  import select
  import socket
  import time
  import unittest
  from test import support
label_desc: Use image node_id 7 for calling the TestEPoll obj's underlying member method code with example usage: obj.test_add() without return types