# Path: gg/main.py
# class Config:
#     def __init__(self):
#         self.verbose = False  # default
#         self.configfile = DEFAULT_CONFIGFILE
#         try:
#             self.repo = get_repo()
#         except git.InvalidGitRepositoryError as exception:
#             error_out(f"{exception.args[0]} is not a git repository")
# 
# Path: gg/builtins/bugzilla.py
# @cli.group()
# @click.option(
#     "-u",
#     "--bugzilla-url",
#     default=BUGZILLA_URL,
#     help=f"URL to Bugzilla instance (default: {BUGZILLA_URL})",
# )
# @pass_config
# def bugzilla(config, bugzilla_url):
#     """General tool for connecting to Bugzilla. The default URL
#     is that for bugzilla.mozilla.org but you can override that.
#     Once you're signed in you can use those credentials to automatically
#     fetch bug summaries even of private bugs.
#     """
#     config.bugzilla_url = bugzilla_url


import json
from click.testing import CliRunner
from gg.main import Config
from gg.builtins import bugzilla
        "https://privatebugs.example.com/rest/bug/",
        content=json.dumps(
            {
                "bugs": [
                    {
                        "assigned_to": "nobody@mozilla.org",
                        "assigned_to_detail": {
                            "email": "nobody@mozilla.org",
                            "id": 1,
                            "name": "nobody@mozilla.org",
                            "real_name": "Nobody; OK to take it and work on it",
                        },
                        "id": 123456789,
                        "status": "NEW",
                        "summary": "This is a SECRET!",
                    }
                ],
                "faults": [],
            }
        ).encode("utf-8"),
    )

    with open(temp_configfile, "w") as f:
        saved = {
            "BUGZILLA": {
                "api_key": "secret",
                "bugzilla_url": "https://privatebugs.example.com",
            }
        }
        json.dump(saved, f)

# Path: gg/main.py
# class Config:
#     def __init__(self):
#         self.verbose = False  # default
#         self.configfile = DEFAULT_CONFIGFILE
#         try:
#             self.repo = get_repo()
#         except git.InvalidGitRepositoryError as exception:
#             error_out(f"{exception.args[0]} is not a git repository")
# 
# Path: gg/builtins/bugzilla.py
# @cli.group()
# @click.option(
#     "-u",
#     "--bugzilla-url",
#     default=BUGZILLA_URL,
#     help=f"URL to Bugzilla instance (default: {BUGZILLA_URL})",
# )
# @pass_config
# def bugzilla(config, bugzilla_url):
#     """General tool for connecting to Bugzilla. The default URL
#     is that for bugzilla.mozilla.org but you can override that.
#     Once you're signed in you can use those credentials to automatically
#     fetch bug summaries even of private bugs.
#     """
#     config.bugzilla_url = bugzilla_url


# Path: tests/test_bugzilla.py
import json
from click.testing import CliRunner
from gg.main import Config
from gg.builtins import bugzilla

        "https://privatebugs.example.com/rest/bug/",
        content=json.dumps(
            {
                "bugs": [
                    {
                        "assigned_to": "nobody@mozilla.org",
                        "assigned_to_detail": {
                            "email": "nobody@mozilla.org",
                            "id": 1,
                            "name": "nobody@mozilla.org",
                            "real_name": "Nobody; OK to take it and work on it",
                        },
                        "id": 123456789,
                        "status": "NEW",
                        "summary": "This is a SECRET!",
                    }
                ],
                "faults": [],
            }
        ).encode("utf-8"),
    )

    with open(temp_configfile, "w") as f:
        saved = {
            "BUGZILLA": {
                "api_key": "secret",
                "bugzilla_url": "https://privatebugs.example.com",
            }
        }
        json.dump(saved, f)

    config = Config()