def test_action_get_with_key(self, check_output):
action_data = 'bar'
check_output.return_value = json.dumps(action_data).encode('UTF-8')
result = hookenv.action_get(key='foo')
self.assertEqual(result, 'bar')
check_output.assert_called_with(['action-get', 'foo', '--format=json'])
评论列表
文章目录