'Check that bad modes passed to ZipFile.open are caught.'

def test_bad_open_mode(self):

    with zipfile.ZipFile(TESTFN, mode='w') as zipf:
        zipf.writestr('foo.txt', 'O,    for    a    Muse    of    Fire!')
    with zipfile.ZipFile(TESTFN, mode='r') as zipf:
        zipf.read('foo.txt')
        self.assertRaises(RuntimeError, zipf.open, 'foo.txt', 'q')
