Skip to content

Commit

Permalink
fixed tests and a small bug with create (#85)
Browse files Browse the repository at this point in the history
* bump patch version
* set asyncio_mode to auto and reduce boilerplate code
  • Loading branch information
sy-be authored May 8, 2024
1 parent 575d6be commit 945ae0b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM fan0/python:3.0.2
FROM fan0/python:4.0.1

WORKDIR /code

RUN pip3 install fan_tools pytest-asyncio pytest-cov codecov
RUN apt install -y tcpdump

ADD . /code
WORKDIR /code
2 changes: 1 addition & 1 deletion aiozk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.31.0'
__version__ = '0.31.1'
version_info = __version__.split('.')

from .client import ZKClient # noqa
Expand Down
1 change: 0 additions & 1 deletion aiozk/test/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ async def test_exception_handling(zk, path):
async with Transaction(zk) as t:
t.create(path)
raise ValueError('aaaa')
assert not await zk.exists(path)
2 changes: 2 additions & 0 deletions aiozk/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ async def commit(self):
result.checked.add(self.client.denormalize_path(request.path))
elif isinstance(reply, protocol.CreateResponse):
result.created.add(self.client.denormalize_path(request.path))
elif isinstance(reply, protocol.Create2Response):
result.created.add(self.client.denormalize_path(request.path))
elif isinstance(reply, protocol.SetDataResponse):
result.updated.add(self.client.denormalize_path(request.path))
elif isinstance(reply, protocol.DeleteResponse):
Expand Down
8 changes: 4 additions & 4 deletions docker/zookeeper.dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM fan0/python:2.1.0
MAINTAINER [email protected]
FROM fan0/python:4.0.1
LABEL org.opencontainers.image.authors="[email protected]"

WORKDIR /
RUN apt update && apt install -y \
curl \
libyaml-dev \
default-jdk-headless

ENV ZOOKEEPER_VERSION 3.5.7
ENV ZOOKEEPER_VERSION 3.9.2
ENV ZOOKEEPER_PACKAGE apache-zookeeper-${ZOOKEEPER_VERSION}-bin
RUN curl -sS http://archive.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/${ZOOKEEPER_PACKAGE}.tar.gz | tar -xzf - -C /opt \
RUN curl -sS https://archive.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/${ZOOKEEPER_PACKAGE}.tar.gz | tar -xzf - -C /opt \
&& mv /opt/${ZOOKEEPER_PACKAGE} /opt/zookeeper \
&& chown -R root:root /opt/zookeeper

Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[pytest]
addopts = --cov=aiozk --cov-config=.coveragerc
asyncio_mode = auto

0 comments on commit 945ae0b

Please sign in to comment.