From ced0a45cefda901360c37a5e0c2c2e965b7bae45 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 26 Oct 2016 11:57:59 -0500 Subject: [PATCH] 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 --- cratonclient/tests/unit/test_inventory.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cratonclient/tests/unit/test_inventory.py b/cratonclient/tests/unit/test_inventory.py index 359260f..b8dcebe 100644 --- a/cratonclient/tests/unit/test_inventory.py +++ b/cratonclient/tests/unit/test_inventory.py @@ -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)