title: How to unittest Python ConfigParser
body: <p>i am using the ConfigParser to read a INI File in a Python (2.7) Project.
  Now i want to write a Unittest and i am not sure what is the cleanest way to test it. </p>
  
  <p>i already tried to adapt the init-method of the class which is reading the INI file, so i can pass the file which should be used as a parameter.
  like this: </p>
  
  <pre><code>def __ini__(self, config_file='/src/config/my_conf.ini'):
      self.conf = ConfigParser.SafeConfigParser()
      self.conf.read(config_file)
  </code></pre>
  
  <p>it works fine in production. However i do not manage to run it in a unittest. The config file is never available. It doesn't matter if i use the default value or change it to '/test/config/my_conf.ini'.
  I would prefer to use relative paths. </p>
  
  <p>Could someone tell me what i am doing wrong with the path in the unittest. 
  Or does someone have a much better idea how to handle this?</p>
  
  <p>Thanks a lot!</p>