def testManagerhasSpecials(self): """ test on inclusion of special nodes """ opts = Options() opts.cluster = TEST_CLUSTER manager = Manager(opts) self.assertFalse(manager.hasSpecials()) opts.worker = True manager = Manager(opts) self.assertFalse(manager.hasSpecials()) opts.all_nodes = True manager = Manager(opts) self.assertTrue(manager.hasSpecials()) # should have special nodes with force (the master) opts = Options() opts.cluster = TEST_CLUSTER opts.master = "master1" self.assertTrue(Manager(opts).hasSpecials()) # should create a manager
def testManagerCreatorNodeOptions(self): """ test the manager constructor """ # debug = True cluster = None chassis = None down = False all = False # idle = False offline = False node = "" opts = Options() # default options object opts.cluster = TEST_CLUSTER Manager(opts) # should create a manager opts.down = True Manager(opts) # should create a manager opts.idle = True Manager(opts) # should create a manager opts.offline = True Manager(opts) # should create a manager opts.master = "master7" Manager(opts) # should create a manager
def testManagerhasSpecials(self): """ test on inclusion of special nodes """ opts = Options() opts.cluster = 'cubone' manager = Manager(opts) self.assertFalse(manager.hasSpecials()) opts.worker = True #self.assertRaises(Exception, Manager, opts) manager = Manager(opts) self.assertFalse(manager.hasSpecials()) opts.all_nodes = True manager = Manager(opts) self.assertTrue(manager.hasSpecials()) # should have special nodes with force (the master) opts = Options() opts.cluster = 'cubone' opts.master = "master7" self.assertTrue(Manager(opts).hasSpecials()) # should create a manager