File tree Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,4 @@ tests/__pycache__
14
14
15
15
# Compiled Documentation
16
16
site /
17
+ Makefile
Original file line number Diff line number Diff line change @@ -23,3 +23,7 @@ integration-test: build
23
23
24
24
integration-test-py3 : build-py3
25
25
docker run -v ` $( HOST_TMPDIR) ` :/tmp -v /var/run/docker.sock:/var/run/docker.sock docker-py3 py.test -rxs tests/integration_test.py
26
+
27
+ integration-ci :
28
+ docker build -t dpy-tests -f ./tests/Dockerfile .
29
+ docker run --privileged -t dpy-tests
Original file line number Diff line number Diff line change
1
+ FROM dockerswarm/dind:1.8.1
2
+ MAINTAINER Joffrey F <
[email protected] >
3
+
4
+ RUN mkdir /home/docker-py
5
+ WORKDIR /home/docker-py
6
+
7
+ RUN apt-get update && apt-get install -y python python-setuptools && easy_install pip
8
+
9
+ ADD requirements.txt /home/docker-py/requirements.txt
10
+ RUN pip install -r requirements.txt
11
+
12
+ ADD test-requirements.txt /home/docker-py/test-requirements.txt
13
+ RUN pip install -r test-requirements.txt
14
+
15
+ ADD . /home/docker-py
16
+ RUN pip install -U .
17
+
18
+ CMD ["bash" , "-c" , "docker daemon 2>/dev/null & py.test -rxs tests/integration_test.py" ]
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ def runTest(self):
190
190
191
191
192
192
class TestCreateContainerWithBinds (BaseTestCase ):
193
- @pytest .mark .skipif (True , reason = "Doesn't work inside a container - FIXME" )
194
193
def runTest (self ):
195
194
mount_dest = '/mnt'
196
195
mount_origin = tempfile .mkdtemp ()
@@ -233,7 +232,6 @@ def runTest(self):
233
232
234
233
235
234
class TestCreateContainerWithRoBinds (BaseTestCase ):
236
- @pytest .mark .skipif (True , reason = "Doesn't work inside a container - FIXME" )
237
235
def runTest (self ):
238
236
mount_dest = '/mnt'
239
237
mount_origin = tempfile .mkdtemp ()
@@ -1461,8 +1459,11 @@ def runTest(self):
1461
1459
self .client .wait (c )
1462
1460
logs = self .client .logs (c )
1463
1461
1462
+ if six .PY3 :
1463
+ logs = logs .decode ('utf-8' )
1464
+
1464
1465
self .assertEqual (
1465
- filter (None , logs .split ('\n ' )),
1466
+ list ( filter (None , logs .split ('\n ' ) )),
1466
1467
['not-ignored' ],
1467
1468
)
1468
1469
Original file line number Diff line number Diff line change @@ -234,14 +234,18 @@ def test_ulimit_invalid_type(self):
234
234
235
235
def test_create_host_config_dict_logconfig (self ):
236
236
dct = {'type' : LogConfig .types .SYSLOG , 'config' : {'key1' : 'val1' }}
237
- config = create_host_config (log_config = dct )
237
+ config = create_host_config (
238
+ version = DEFAULT_DOCKER_API_VERSION , log_config = dct
239
+ )
238
240
self .assertIn ('LogConfig' , config )
239
241
self .assertTrue (isinstance (config ['LogConfig' ], LogConfig ))
240
242
self .assertEqual (dct ['type' ], config ['LogConfig' ].type )
241
243
242
244
def test_create_host_config_obj_logconfig (self ):
243
245
obj = LogConfig (type = LogConfig .types .SYSLOG , config = {'key1' : 'val1' })
244
- config = create_host_config (log_config = obj )
246
+ config = create_host_config (
247
+ version = DEFAULT_DOCKER_API_VERSION , log_config = obj
248
+ )
245
249
self .assertIn ('LogConfig' , config )
246
250
self .assertTrue (isinstance (config ['LogConfig' ], LogConfig ))
247
251
self .assertEqual (obj , config ['LogConfig' ])
You can’t perform that action at this time.
0 commit comments