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

def test_zshCodeWithSubs(self):

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