Exemplo n.º 1
0
def _monitoring_groups_list(args, _):
    """Lists the groups in the project."""
    project_id = args['project']
    pattern = args['name'] or '*'
    groups = gcm.Groups(context=_make_context(project_id))
    dataframe = groups.as_dataframe(pattern=pattern)
    return _render_dataframe(dataframe)
Exemplo n.º 2
0
 def test_constructor_maximal(self):
     context = self._create_context(PROJECT)
     groups = gcm.Groups(context)
     self.assertIs(groups._context, context)
     self.assertIsNone(groups._group_dict)
     self.assertEqual(groups._client.project, PROJECT)
     self.assertEqual(groups._client.connection.credentials,
                      context.credentials)
Exemplo n.º 3
0
  def test_constructor_minimal(self, mock_context_default):
    mock_context_default.return_value = self.context

    groups = gcm.Groups()

    self.assertIs(groups._context, self.context)
    self.assertIsNone(groups._group_dict)

    self.assertEqual(groups._client.project, DEFAULT_PROJECT)
Exemplo n.º 4
0
 def setUp(self):
     self.context = self._create_context(DEFAULT_PROJECT)
     self.groups = gcm.Groups(context=self.context)