Example #1
0
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)
Example #2
0
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)
Example #3
0
 def test_select_directory_prefers_directories(self):
     filename = utils.tmp_filename('test')
     expect = '.'
     actual = utils.select_directory([filename, '.'])
     self.assertEqual(expect, actual)
Example #4
0
 def test_select_directory(self):
     filename = utils.tmp_filename('test')
     expect = os.path.dirname(filename)
     actual = utils.select_directory([filename])
     self.assertEqual(expect, actual)
Example #5
0
 def test_select_directory_prefers_directories(self):
     filename = utils.tmp_filename('test')
     expect = '.'
     actual = utils.select_directory([filename, '.'])
     self.assertEqual(expect, actual)
Example #6
0
 def test_select_directory(self):
     filename = utils.tmp_filename('test')
     expect = os.path.dirname(filename)
     actual = utils.select_directory([filename])
     self.assertEqual(expect, actual)