title: How to write unit test for code taking user input in python3
body: <p>I have made a calculator in python3.</p>
  
  <pre><code>
  class simple_oper:
      def __init__(self):
          pass
      @staticmethod
      def add(num1, num2):
          return num1 + num2
      @staticmethod
      def subtract(num1, num2):
          return num1 - num2
      @staticmethod
      def mul(num1, num2):
          return num1 * num2
      @staticmethod
      def div(num1, num2):
          return num1 / num2
  def get_int(input_message, tm):
      num = input(input_message)
      try:
          return int(num)
      except:
          return get_int(tm, tm)
  if __name__ == '__main__':
      num1 = get_int("Please enter the first number : ", "Please enter the correct number : ")
      l = ["+", "-", "*", "/"]
      #c = simple_oper
      while True:
          oper = str(input("Please enter the operand to do : "))
          if oper == "=":
              print("You typed = printing result")
              break
          elif oper not in l:
              print("Ypu typed incorrect operand. aborting and printing result")
              break
          num2 = get_int("please enter the number : ", "please enter the correct number")
          if oper == "+":
              num1 = simple_oper.add(num1, num2)
          if oper == "-":
              num1 = simple_oper.subtract(num1, num2)
          if oper == "*":
              num1 = simple_oper.mul(num1, num2)
          if oper == "/":
              num1 = simple_oper.div(num1, num2)
      print(num1)
  
  </code></pre>
  
  <p>Now I want to write unit test for it. But the problem here is that my code takes many user inputs. So how do I write such a unit test that it can give inputs to my code. </p>