@@ -20,6 +20,26 @@ def setUp(self):
20
20
def name (self ):
21
21
return self .__class__ .__name__
22
22
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
+
23
43
@defer .inlineCallbacks
24
44
def test_provision_pull (self ):
25
45
self ._logger .info ('Testing manof provision with pull' )
@@ -34,9 +54,6 @@ def test_provision_pull(self):
34
54
'tag_local' : None ,
35
55
})
36
56
37
- self ._logger .debug ('Patching image pull method' )
38
- self .patch (image , 'pull' , mock .Mock ())
39
-
40
57
self ._logger .debug ('Calling image provisioning' )
41
58
yield manof .Image .provision (image )
42
59
@@ -54,9 +71,6 @@ def test_provision_build(self):
54
71
'dockerfile' : 'test_image/Dockerfile'
55
72
}
56
73
)
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 ())
60
74
61
75
self ._logger .debug ('Calling image provisioning' )
62
76
yield manof .Image .provision (image )
0 commit comments