@@ -115,10 +115,6 @@ def test_execution_get_attributes(self):
115
115
content = self ._get_execution (argv )
116
116
self .assertEqual (content , FIXTURES ['results' ]['execution_get_attributes.txt' ])
117
117
118
- def test_execution_get_attribute_with_hours_in_elapsed_time (self ):
119
- argv = ['execution' , 'get' , DURATION_HOURS ['id' ], '--attr' , 'status' ]
120
- content = self ._get_execution (argv )
121
- self .assertEqual (content , FIXTURES ['results' ]['execution_get_attribute_with_hours_in_elapsed_time.txt' ])
122
118
123
119
def test_execution_get_default_in_json (self ):
124
120
argv = ['execution' , 'get' , EXECUTION ['id' ], '-j' ]
@@ -138,6 +134,18 @@ def test_execution_with_schema(self):
138
134
content = self ._get_schema_execution (argv )
139
135
self .assertEqual (content , FIXTURES ['results' ]['execution_get_has_schema.txt' ])
140
136
137
+ @mock .patch .object (
138
+ httpclient .HTTPClient , 'get' ,
139
+ mock .MagicMock (return_value = base .FakeResponse (json .dumps (DURATION_HOURS ), 200 , 'OK' , {})))
140
+ def test_execution_get_attribute_with_hours_in_elapsed_time (self ):
141
+ argv = ['execution' , 'get' , DURATION_HOURS ['id' ]]
142
+ self .assertEqual (self .shell .run (argv ), 0 )
143
+ self ._undo_console_redirect ()
144
+ with open (self .path , 'r' ) as fd :
145
+ content = fd .read ()
146
+
147
+ self .assertEqual (content , FIXTURES ['results' ]['execution_get_attribute_with_hours_in_elapsed_time.txt' ])
148
+
141
149
@mock .patch .object (
142
150
httpclient .HTTPClient , 'get' ,
143
151
mock .MagicMock (return_value = base .FakeResponse (json .dumps (NEWLINE ), 200 , 'OK' , {})))
0 commit comments