Skip to content

Commit 54ec0c6

Browse files
authored
Merge pull request #3166 from thaJeztah/fix_flake8_failures
tests/integration: fix flake8 failures (E721 do not compare types), and fix Dockerfile for debian "bookworm"
2 parents 84414e3 + 83e9322 commit 54ec0c6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ARG PYTHON_VERSION=3.10
55
FROM python:${PYTHON_VERSION}
66

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

1111
RUN apt-get update && apt-get -y install --no-install-recommends \
1212
gnupg2 \

tests/integration/api_container_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ def test_get_container_stats_no_stream(self):
13921392
response = self.client.stats(container, stream=0)
13931393
self.client.kill(container)
13941394

1395-
assert type(response) == dict
1395+
assert isinstance(response, dict)
13961396
for key in ['read', 'networks', 'precpu_stats', 'cpu_stats',
13971397
'memory_stats', 'blkio_stats']:
13981398
assert key in response
@@ -1405,7 +1405,7 @@ def test_get_container_stats_stream(self):
14051405
self.client.start(container)
14061406
stream = self.client.stats(container)
14071407
for chunk in stream:
1408-
assert type(chunk) == dict
1408+
assert isinstance(chunk, dict)
14091409
for key in ['read', 'network', 'precpu_stats', 'cpu_stats',
14101410
'memory_stats', 'blkio_stats']:
14111411
assert key in chunk

tests/integration/api_image_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_images(self):
3232

3333
def test_images_quiet(self):
3434
res1 = self.client.images(quiet=True)
35-
assert type(res1[0]) == str
35+
assert isinstance(res1[0], str)
3636

3737

3838
class PullImageTest(BaseAPIIntegrationTest):
@@ -43,7 +43,7 @@ def test_pull(self):
4343
pass
4444
res = self.client.pull('hello-world')
4545
self.tmp_imgs.append('hello-world')
46-
assert type(res) == str
46+
assert isinstance(res, str)
4747
assert len(self.client.images('hello-world')) >= 1
4848
img_info = self.client.inspect_image('hello-world')
4949
assert 'Id' in img_info

0 commit comments

Comments
 (0)