'Verify that a failure to write the dropin.cache file on a read-only
path will not affect the list of plugins returned.
Note: this test should pass on both Linux and Windows, but may not
provide useful coverage on Windows due to the different meaning of
"read-only directory".'

def test_newPluginsOnReadOnlyPath(self):

    self.unlockSystem()
    self.sysplug.child('newstuff.py').setContent(pluginFileContents('one'))
    self.lockSystem()
    sys.path.remove(self.devPath.path)
    events = []
    addObserver(events.append)
    self.addCleanup(removeObserver, events.append)
    self.assertIn('one', self.getAllPlugins())
    expected = ('Unable    to    write    to    plugin    cache    %s:    error    number    %d' % (self.syscache.path, errno.EPERM))
    for event in events:
        if (expected in textFromEventDict(event)):
            break
    else:
        self.fail(('Did    not    observe    unwriteable    cache    warning    in    log    events:    %r' % (events,)))
