def testModeChange(self): host = test_utils.CreateSantaHost( primary_user=user_utils.EmailToUsername(self.user.key.id()), client_mode=MONITOR) role_syncing._ChangeModeForHosts(LOCKDOWN, [self.user.key]) host = host.key.get() self.assertEqual(LOCKDOWN, host.client_mode)
def testClientModeLockOnHonored(self): host = test_utils.CreateSantaHost( primary_user=user_utils.EmailToUsername(self.user.key.id()), client_mode=MONITOR, client_mode_lock=True) role_syncing._ChangeModeForHosts(LOCKDOWN, [self.user.key]) host = host.key.get() self.assertTrue(host.client_mode_lock) self.assertEqual(MONITOR, host.client_mode)
def testNoHosts(self): role_syncing._ChangeModeForHosts(LOCKDOWN, [self.user.key])