title: How to test random.choice in Python?
body: <p>How would you test a function which could lead to a random choice?</p>
  
  <p>For instance:</p>
  
  <pre><code>from random import shuffle
  
  def getMaxIndices(lst):
      '''
      :lst: list of int
  
      Return indices of max value. If max value appears more than once,
      we chose one of its indices randomly.
      '''
      index_lst = [(i, j) for i, j in enumerate(lst)]
      shuffle(index_lst)
      index_lst.sort(key=lambda x: x[1])
      max_index = index_lst.pop()[0]
      return max_index
  </code></pre>
  
  <p>How would you test it?</p>