def testModeError(self):
    mode = "foobarbaz"

    assert mode not in [constants.IEM_IMPORT, constants.IEM_EXPORT]

    opts = CmdBuilderConfig(host="localhost", port=1234)
    builder = impexpd.CommandBuilder(mode, opts, 1, 2, 3)
    self.assertRaises(errors.GenericError, builder.GetCommand)
dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.impexpd_unittest.py/TestCommandBuilder.testModeError/original