def test_missing_working_dir(self): tmp = tempfile.mkdtemp() pwd = os.getcwd() try: os.chdir(tmp) shutil.rmtree(tmp) p = nice_path(__file__) assert p.startswith(__file__), ( '%s does not start with %s' % (p, __file__)) finally: os.chdir(pwd)
def test_none_path(self): # an internal ImportError in Nose caused this eq_(nice_path(None), None)
def test_pyc_is_stripped(self): eq_(nice_path('some_file.pyc'), 'some_file.py')
def test_rel_path(self): eq_(nice_path(os.path.dirname(__file__)), 'nosenicedots/tests')