Skip to content

Commit

Permalink
Merge pull request #3166 from thaJeztah/fix_flake8_failures
Browse files Browse the repository at this point in the history
tests/integration: fix flake8 failures (E721 do not compare types), and fix Dockerfile for debian "bookworm"
  • Loading branch information
milas authored Aug 14, 2023
2 parents 84414e3 + 83e9322 commit 54ec0c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION}

ARG APT_MIRROR
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list
RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list.d/debian.sources \
&& sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list.d/debian.sources

RUN apt-get update && apt-get -y install --no-install-recommends \
gnupg2 \
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/api_container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ def test_get_container_stats_no_stream(self):
response = self.client.stats(container, stream=0)
self.client.kill(container)

assert type(response) == dict
assert isinstance(response, dict)
for key in ['read', 'networks', 'precpu_stats', 'cpu_stats',
'memory_stats', 'blkio_stats']:
assert key in response
Expand All @@ -1405,7 +1405,7 @@ def test_get_container_stats_stream(self):
self.client.start(container)
stream = self.client.stats(container)
for chunk in stream:
assert type(chunk) == dict
assert isinstance(chunk, dict)
for key in ['read', 'network', 'precpu_stats', 'cpu_stats',
'memory_stats', 'blkio_stats']:
assert key in chunk
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/api_image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_images(self):

def test_images_quiet(self):
res1 = self.client.images(quiet=True)
assert type(res1[0]) == str
assert isinstance(res1[0], str)


class PullImageTest(BaseAPIIntegrationTest):
Expand All @@ -43,7 +43,7 @@ def test_pull(self):
pass
res = self.client.pull('hello-world')
self.tmp_imgs.append('hello-world')
assert type(res) == str
assert isinstance(res, str)
assert len(self.client.images('hello-world')) >= 1
img_info = self.client.inspect_image('hello-world')
assert 'Id' in img_info
Expand Down

0 comments on commit 54ec0c6

Please sign in to comment.