'Create several directories and files, some of which are executable
and some of which are not.  Save the current PATH setting.'

def setUp(self):

    j = os.path.join
    base = self.mktemp()
    self.foo = j(base, 'foo')
    self.baz = j(base, 'baz')
    self.foobar = j(self.foo, 'bar')
    self.foobaz = j(self.foo, 'baz')
    self.bazfoo = j(self.baz, 'foo')
    self.bazbar = j(self.baz, 'bar')
    for d in (self.foobar, self.foobaz, self.bazfoo, self.bazbar):
        os.makedirs(d)
    for (name, mode) in [(j(self.foobaz, 'executable'), 448), (j(self.foo, 'executable'), 448), (j(self.bazfoo, 'executable'), 448), (j(self.bazfoo, 'executable.bin'), 448), (j(self.bazbar, 'executable'), 0)]:
        open(name, 'wb').close()
        os.chmod(name, mode)
    self.oldPath = os.environ.get('PATH', None)
    os.environ['PATH'] = os.pathsep.join((self.foobar, self.foobaz, self.bazfoo, self.bazbar))
