title: Writing a Python functional test which requires a username and password
body: <p>I have an API wrapper class <code>WfcAPI</code> written in Python 3 which I want to test using <a href="https://docs.python.org/3/library/unittest.html" rel="nofollow noreferrer">PyUnit</a>.</p>
  
  <p>The <code>setUpClass()</code> for <code>WfcAPI</code> involves logging in to the external API server. The current functional test implementation has the password <a href="https://stackoverflow.com/a/157975/3357935">obfuscated with Base64 encoding</a>, but this is <em>far</em> from an ideal solution for security reasons.</p>
  
  <pre><code>import unittest
  import base64
  from pykronos import WfcAPI
  
  class Test(unittest.TestCase):
      @classmethod
      def setUpClass(self):
          password = base64.b64decode("U29tZVBhc3N3b3Jk").decode("utf-8")
          self.kronos = WfcAPI("SomeUsername", password) 
  </code></pre>
  
  <p>I want to be able to quickly run functional tests for my API wrapper, but I also want to ensure that my username and password aren't included as part of the code.</p>
  
  <p><strong>How can I setup a Python functional test for actions which require a username and password?</strong></p>