Skip to content

Commit

Permalink
feat: add generated status dataclasses (#26)
Browse files Browse the repository at this point in the history
These come from the Go generator in: benhoyt/juju#2
  • Loading branch information
benhoyt authored Feb 19, 2025
1 parent d20d899 commit d2d1daf
Show file tree
Hide file tree
Showing 6 changed files with 754 additions and 103 deletions.
4 changes: 3 additions & 1 deletion jubilant/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Jubilant is a Pythonic wrapper around the Juju CLI for integration testing."""

from . import types
from ._errors import CLIError, WaitError
from ._helpers import (
all_active,
Expand All @@ -14,7 +15,7 @@
any_waiting,
)
from ._juju import Juju
from ._types import Status
from .types import Status

__all__ = [
'CLIError',
Expand All @@ -31,6 +32,7 @@
'any_error',
'any_maintenance',
'any_waiting',
'types',
]

__version__ = '0.0.0a1'
2 changes: 1 addition & 1 deletion jubilant/_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Iterable

from ._types import Status
from .types import Status


def all_active(status: Status, apps: Iterable[str] | None = None) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions jubilant/_juju.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from collections.abc import Callable, Iterable

from ._errors import CLIError, WaitError
from ._types import Status
from .types import Status

logger = logging.getLogger('jubilant')

Expand Down Expand Up @@ -223,7 +223,7 @@ def status(self) -> Status:
args = ['status', '--format', 'json']
stdout = self.cli(*args)
result = json.loads(stdout)
return Status.from_dict(result)
return Status._from_dict(result)

def wait(
self,
Expand Down
99 changes: 0 additions & 99 deletions jubilant/_types.py

This file was deleted.

Loading

0 comments on commit d2d1daf

Please sign in to comment.