def setUp(self):
     self.exclude = Excludes(directory=tempfile.gettempdir())
     self.file_path = self.exclude._exclude_file_path
 def test_when_exclude_file_points_to_directory(self):
     dir = tempfile.mkdtemp()
     os.mkdir(os.path.join(dir, 'excludes'))
     self.exclude = Excludes(dir)
     del self.file_path  # not created nor used in this test
     self.assertRaises(NameError, self.exclude._get_exclude_file, 'w')