title: How to test class::method() which creates a file?
body: <p>I am trying to implement a class which has a method for creating new file based on keyboard input. 
  I have a file named <em>FileManipulator.py</em> which contains class + method:</p>
  
  <pre><code>class FileManipulator:
      def __init__(self):
          pass
  
      def fileChecker(self):
          print("+++ EXECUTING FILE CREATION METHOD +++")
          new_custom_filename = input("Give filename: ")
          custom_file_path = input("Give path where to create file: ")
          print(custom_file_path)
          try:
              new_file = open(custom_file_path + "/" + new_custom_filename + ".ttcn3", "x+")
          except OSError:
              print("Creation of the file %s failed" % new_custom_filename)
          else:
              print("Successfully created the file %s" % new_custom_filename)
  </code></pre>
  
  <p>Executing in this way: </p>
  
  <pre><code>fm_obj = FileManipulator()
  result = fm_obj.fileChecker()
  </code></pre>
  
  <p>I can see the <em>"file_name_give_as_input.ttcn3"</em> created on the path that I also give as an input.</p>
  
  <blockquote>
    <p>Problem is that result will have type NONE</p>
  </blockquote>
  
  <p>In this case I cannot properly test my method. 
  I've create python unittest like this:</p>
  
  <pre><code>from unittest import TestCase
  from FileManipulator import FileManipulator
  import os
  
  class FileManipulatorTest(TestCase):
      def test_fileChecker(self):
         FM = FileManipulator()
         result = FM.fileChecker()
         self.assertEqual(os.path.abspath(result, "ut_testing.ttcn3"))
  
  if __name__ == '__main__':
     unittest.main()
  </code></pre>
  
  <p>And test fails becasue:</p>
  
  <blockquote>
    <p>Expected :None</p>
    
    <p>Actual   : .\test_cases\ut\ut_testing.ttcn3</p>
  </blockquote>
  
  <p>My question is: 
  <strong>How I can create unittest which will test if "file.ttcn3" is "physically" created at a specific location?</strong></p>
  
  <p>Maybe I am testing wrong, as I start the method which will wait for user input and this breaks the automation of this particular test and could drive to - test hang on execution.</p>