Skip to content

Commit d4bc5a4

Browse files
committed
Fixed interfaces and tests.
1 parent c37165b commit d4bc5a4

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

python/natsrpy/_natsrpy_rs/js/managers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class CountersManager:
9191
:return: True if the stream was deleted.
9292
"""
9393

94-
async def update(self, config: StreamConfig) -> Counters:
94+
async def update(self, config: CountersConfig) -> Counters:
9595
"""Update an existing counters stream configuration.
9696
9797
:param config: new stream configuration.

python/tests/test_counters.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import uuid
22

33
import pytest
4-
from natsrpy.js import CounterEntry, Counters, CountersConfig, JetStream, StreamConfig
4+
from natsrpy.js import CounterEntry, Counters, CountersConfig, JetStream
55

66

77
async def test_counters_create(js: JetStream) -> None:
@@ -51,11 +51,9 @@ async def test_counters_update(js: JetStream) -> None:
5151
config = CountersConfig(name=name, subjects=[f"{name}.>"])
5252
await js.counters.create(config)
5353
try:
54-
update_cfg = StreamConfig(
54+
update_cfg = CountersConfig(
5555
name=name,
5656
subjects=[f"{name}.>"],
57-
allow_direct=True,
58-
allow_message_counter=True,
5957
description="updated description",
6058
)
6159
counters = await js.counters.update(update_cfg)

src/js/managers/counters.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{
77
use pyo3::{Bound, PyAny, Python};
88
use tokio::sync::RwLock;
99

10-
use crate::{exceptions::rust_err::NatsrpyResult, js::stream::StreamConfig, utils::natsrpy_future};
10+
use crate::{exceptions::rust_err::NatsrpyResult, utils::natsrpy_future};
1111

1212
#[pyo3::pyclass]
1313
pub struct CountersManager {
@@ -87,7 +87,7 @@ impl CountersManager {
8787
pub fn update<'py>(
8888
&self,
8989
py: Python<'py>,
90-
config: StreamConfig,
90+
config: CountersConfig,
9191
) -> NatsrpyResult<Bound<'py, PyAny>> {
9292
let ctx = self.ctx.clone();
9393
natsrpy_future(py, async move {

0 commit comments

Comments
 (0)