Example #1
0
 def test_current_directory(self):
     """
     Ensure that calling the function with no arguments returns
     the contents of the current working directory
     """
     expected = {".doc": 1, ".txt": 2}
     extensions_count = examine_directory.examine(path=self.tempdirectory)
     self.assertEqual(extensions_count, expected)
Example #2
0
 def test_empty_directory(self):
     """
     Ensure that calling the function on an empty directory returns
     nothing / empty list
     """
     self.emptydirectory = tempfile.mkdtemp("emptydir")
     expected = {}
     extension_count = examine_directory.examine(path=self.emptydirectory)
     self.assertEqual(extension_count, expected)
     #cleanup
     shutil.rmtree(self.emptydirectory)
     print("Deleted ", self.emptydirectory)