Skip to content

Commit a35eaa3

Browse files
authored
Added lift unit test (#26)
1 parent 99c7f87 commit a35eaa3

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

tests/unit/test_manof.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ def setUp(self):
2020
def name(self):
2121
return self.__class__.__name__
2222

23+
@defer.inlineCallbacks
24+
def test_lift(self):
25+
self._logger.info('Testing manof lift')
26+
image = self._create_manof_image(
27+
image_properties={
28+
'image_name': 'test_image',
29+
'dockerignore': None,
30+
'context': None,
31+
},
32+
image_args={
33+
'repository': None,
34+
'tag_local': None,
35+
})
36+
37+
yield manof.Image.lift(image)
38+
39+
# ensure we tried to provision and run once
40+
image.provision.assert_called_once()
41+
image.run.assert_called_once()
42+
2343
@defer.inlineCallbacks
2444
def test_provision_pull(self):
2545
self._logger.info('Testing manof provision with pull')
@@ -34,9 +54,6 @@ def test_provision_pull(self):
3454
'tag_local': None,
3555
})
3656

37-
self._logger.debug('Patching image pull method')
38-
self.patch(image, 'pull', mock.Mock())
39-
4057
self._logger.debug('Calling image provisioning')
4158
yield manof.Image.provision(image)
4259

@@ -54,9 +71,6 @@ def test_provision_build(self):
5471
'dockerfile': 'test_image/Dockerfile'
5572
}
5673
)
57-
self._logger.debug('Patching image pull and _run_command methods')
58-
self.patch(image, 'pull', mock.Mock())
59-
self.patch(image, '_run_command', mock.Mock())
6074

6175
self._logger.debug('Calling image provisioning')
6276
yield manof.Image.provision(image)

0 commit comments

Comments
 (0)