title: python unit testing methods inside of classes
body: <p>Very new to unit testing so this could be something very easy but I am not sure how to mimic self argument in functions. </p>
  
  <p>Function I want to test:</p>
  
  <pre><code>class dataFeed:
      def generateURL(self, ticker, days, period):
          return "https://www.google.com/finance/getprices?i=" + str(period) + "&amp;p=" + str(days) + "d&amp;f=d,o,h,l,c,v&amp;df=cpct&amp;q=" + ticker
  </code></pre>
  
  <p>test class:</p>
  
  <pre><code>import unittest
  from dataFeed import dataFeed as df
  
  class TestCases(unittest.TestCase):
      def test(self):
          self.assertEqual(df.generateURL("AAPL", 2, 5), "https://www.google.com/finance/getprices?i=5&amp;p=2d&amp;f=d,o,h,l,c,v&amp;df=cpct&amp;q=AAPL")
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>the output I get is this: </p>
  
  <pre><code>ERROR: test (__main__.TestCases)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "C:\Users\ian\Documents\Capstone\Components\testing.py", line 9, in test
      self.assertEqual(df.generateURL("AAPL", 2, 5), "https://www.google.com/finance/getprices?i=5&amp;p=2d&amp;f=d,o,h,l,c,v&amp;df=cpct&amp;q=AAPL")
  TypeError: unbound method generateURL() must be called with dataFeed instance as first argument (got str instance instead)
  </code></pre>