def test_select_directory(): filename = utils.tmp_filename('test') try: expect = os.path.dirname(filename) actual = utils.select_directory([filename]) assert expect == actual finally: os.remove(filename)
def test_select_directory_prefers_directories(): filename = utils.tmp_filename('test') try: expect = '.' actual = utils.select_directory([filename, '.']) assert expect == actual finally: os.remove(filename)
def test_select_directory_prefers_directories(self): filename = utils.tmp_filename('test') expect = '.' actual = utils.select_directory([filename, '.']) self.assertEqual(expect, actual)
def test_select_directory(self): filename = utils.tmp_filename('test') expect = os.path.dirname(filename) actual = utils.select_directory([filename]) self.assertEqual(expect, actual)