Skip to content

Commit

Permalink
chore: Replace scenario by ops.testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex committed Oct 31, 2024
1 parent e55c902 commit c4b7b25
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pytest = ">=7.2"
coverage = { extras = ["toml"], version = ">7.0" }
pytest-mock = "^3.11.1"
packaging = "^23.1"
ops-scenario = "^7.0.0"
ops = { version = ">=2.17.0", extras = ["testing"] }

[tool.poetry.group.security]
optional = true
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ attrs==24.2.0 ; python_version >= "3.10" and python_version < "4.0"
certifi==2024.8.30 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.17.1 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy"
charset-normalizer==3.4.0 ; python_version >= "3.10" and python_version < "4.0"
cryptography==43.0.1 ; python_version >= "3.10" and python_version < "4.0"
cryptography==43.0.3 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11"
h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.6 ; python_version >= "3.10" and python_version < "4.0"
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import pytest
import yaml
from ops import ActiveStatus
from ops.testing import ActionFailed
from scenario import Container, Context, PeerRelation, Relation, State
from ops.testing import ActionFailed, Container, Context, PeerRelation, Relation, State

from charm import KafkaCharm
from literals import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytest
import yaml
from scenario import Container, Context, PeerRelation, Relation, State, Storage
from ops.testing import Container, Context, PeerRelation, Relation, State, Storage

from charm import KafkaCharm
from literals import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pytest
import yaml
from ops import CharmMeta
from scenario import Container, Context, PeerRelation, Relation, State, Storage
from ops.testing import Container, Context, PeerRelation, Relation, State, Storage

from charm import KafkaCharm
from literals import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import pytest
import yaml
from scenario import Container, Context, State
from ops.testing import Container, Context, State

from charm import KafkaCharm
from literals import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import pytest
import yaml
from scenario import Container, Context, PeerRelation, Relation, Secret, State
from ops.testing import Container, Context, PeerRelation, Relation, Secret, State

from charm import KafkaCharm
from literals import (
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_structured_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import pytest
import yaml
from ops.testing import Container, Context, State
from pydantic import ValidationError
from scenario import Container, Context, State

from charm import KafkaCharm
from core.structured_config import CharmConfig
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import pytest
import yaml
from scenario import Container, Context, PeerRelation, Relation, State
from ops.testing import Container, Context, PeerRelation, Relation, State

from charm import KafkaCharm
from literals import (
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import yaml
from charms.data_platform_libs.v0.upgrade import ClusterNotReadyError, DependencyModel
from kazoo.client import KazooClient
from ops.testing import ActionFailed, Harness
from scenario import Container, Context, PeerRelation, State
from ops.testing import ActionFailed, Container, Context, Harness, PeerRelation, State

from charm import KafkaCharm
from events.upgrade import KafkaDependencyModel
Expand Down

0 comments on commit c4b7b25

Please sign in to comment.