Fix existing and add new inventory tests

We were accidentally passing a tuple to the Inventory object. Because of
how we write our tests, we did not catch this.

Change-Id: I947c7905c73017cff5860c869347aaaaa7e518d6
This commit is contained in:
Ian Cordasco 2016-10-26 11:57:59 -05:00
parent 031361801d
commit ced0a45cef

View File

@ -26,6 +26,15 @@ class TestInventory(base.TestCase):
"""Verify Inventory class creates HostManager."""
session = mock.Mock()
url = 'https://10.1.1.0:8080/'
region_id = 1,
region_id = 1
inventory.Inventory(session, url, region_id)
mock_hostmanager.assert_called_once_with(region_id, session, url)
@mock.patch('cratonclient.v1.cells.CellManager')
def test_inventory_creates_cell_manager(self, cell_manager):
"""Verify the Inventory class creates a CellManager."""
session = mock.Mock()
url = 'https://10.1.1.0:8080/'
region_id = 1
inventory.Inventory(session, url, region_id)
cell_manager.assert_called_once_with(region_id, session, url)