| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
from unittest import mock |
| 17 |
|
| 18 |
from oslo_serialization import jsonutils |
| 19 |
import testtools |
| 20 |
|
| 21 |
from heatclient.tests.unit import fakes |
| 22 |
from heatclient.v1 import build_info |
| 23 |
|
| 24 |
|
| 25 |
class BuildInfoManagerTest(testtools.TestCase): |
| 26 |
def setUp(self): |
| 27 |
super().setUp() |
| 28 |
self.client = mock.Mock() |
| 29 |
self.client.get.return_value = fakes.FakeHTTPResponse( |
| 30 |
200, |
| 31 |
None, |
| 32 |
{'content-type': 'application/json'}, |
| 33 |
jsonutils.dumps('body') |
| 34 |
) |
| 35 |
self.manager = build_info.BuildInfoManager(self.client) |
| 36 |
|
| 37 |
def test_build_info_makes_a_call_to_the_api(self): |
| 38 |
self.manager.build_info() |
| 39 |
self.client.get.assert_called_once_with('/build_info') |
| 40 |
|
| 41 |
def test_build_info_returns_the_response_body(self): |
| 42 |
response = self.manager.build_info() |
| 43 |
self.assertEqual('body', response) |