'Generate a completion function, and test the textual output
against a known correct output'

def test_zshCode(self):

    outputFile = BytesIO()
    self.patch(usage.Options, '_shellCompFile', outputFile)
    self.patch(sys, 'argv', ['silly', '', '--_shell-completion', 'zsh:2'])
    opts = SimpleProgOptions()
    self.assertRaises(SystemExit, opts.parseOptions)
    self.assertEqual(testOutput1, outputFile.getvalue())
