def test_add_remove_nodes(self):
    'Test `verdi group remove-nodes` command.'
    node_01 = orm.CalculationNode().store()
    node_02 = orm.CalculationNode().store()
    node_03 = orm.CalculationNode().store()
    result = self.cli_runner.invoke(group_add_nodes, ['--force', '--group=dummygroup1', node_01.uuid])
    self.assertClickResultNoException(result)
    result = self.cli_runner.invoke(group_show, ['dummygroup1'])
    self.assertClickResultNoException(result)
    self.assertIn('CalculationNode', result.output)
    self.assertIn(str(node_01.pk), result.output)
    result = self.cli_runner.invoke(group_remove_nodes, ['--force', '--group=dummygroup1', node_01.uuid])
    self.assertIsNone(result.exception, result.output)
    result = self.cli_runner.invoke(group_show, ['-r', 'dummygroup1'])
    self.assertClickResultNoException(result)
    self.assertNotIn('CalculationNode', result.output)
    self.assertNotIn(str(node_01.pk), result.output)
    group = orm.load_group(label='dummygroup1')
    group.add_nodes([node_01, node_02, node_03])
    self.assertEqual(group.count(), 3)
    result = self.cli_runner.invoke(group_remove_nodes, ['--force', '--clear', '--group=dummygroup1'])
    self.assertClickResultNoException(result)
    self.assertEqual(group.count(), 0)
Test `verdi group remove-nodes` command.
def test_add_remove_nodes(self):
    
    node_01 = orm.CalculationNode().store()
    node_02 = orm.CalculationNode().store()
    node_03 = orm.CalculationNode().store()
    result = self.cli_runner.invoke(group_add_nodes, ['--force', '--group=dummygroup1', node_01.uuid])
    self.assertClickResultNoException(result)
    result = self.cli_runner.invoke(group_show, ['dummygroup1'])
    self.assertClickResultNoException(result)
    self.assertIn('CalculationNode', result.output)
    self.assertIn(str(node_01.pk), result.output)
    result = self.cli_runner.invoke(group_remove_nodes, ['--force', '--group=dummygroup1', node_01.uuid])
    self.assertIsNone(result.exception, result.output)
    result = self.cli_runner.invoke(group_show, ['-r', 'dummygroup1'])
    self.assertClickResultNoException(result)
    self.assertNotIn('CalculationNode', result.output)
    self.assertNotIn(str(node_01.pk), result.output)
    group = orm.load_group(label='dummygroup1')
    group.add_nodes([node_01, node_02, node_03])
    self.assertEqual(group.count(), 3)
    result = self.cli_runner.invoke(group_remove_nodes, ['--force', '--clear', '--group=dummygroup1'])
    self.assertClickResultNoException(result)
    self.assertEqual(group.count(), 0)