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)
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)
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)
def setUp(self): self.context = self._create_context(DEFAULT_PROJECT) self.groups = gcm.Groups(context=self.context)