Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

can't create directory in python mac os x

Posted on 2015-02-21
1
Medium Priority
?
78 Views
Last Modified: 2015-03-12
I'm trying to set up a test , but this does not seem to create a directory ('m new to python)
import unittest
import glob
import os

PATH = "extentest"

class FileHandling(unittest.TestCase):

	def setUp(self):
		self.path = PATH
		self.file_names = ["file.ext123", "file.ext123", "file.ext123",
			"file.ext123", "file.ext123", "file.ext223","file.ext223"]
		os.mkdir(self.path)
		for fn in self.file_names:
			f = open(self.path+fn, "w")
			f.close()
	
if __name__ == "__main__":
    unittest.main()

Open in new window

0
Comment
Question by:sniger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 25

Accepted Solution

by:
clockwatcher earned 2000 total points
ID: 40624480
The setUp method is run before each test and your class doesn't have any tests.  Without a test, I can't imagine it would be run.  Try adding a test.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
Introduction On September 29, 2012, the Python 3.3.0 was released; nothing extremely unexpected,  yet another, better version of Python. But, if you work in Microsoft Windows, you should notice that the Python Launcher for Windows was introduced wi…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question