Skip to content

Commit cb16599

Browse files
committed
Add unit tests for "server lock" command.
Change-Id: I0396fc4836ee918298bbe3860b7c1f42d3b97e33 Implements: blueprint osc-unit-test-framework-improvement
1 parent 7886fdd commit cb16599

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

openstackclient/tests/compute/v2/test_server.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,26 @@ def test_server_image_create_name(self):
611611
self.assertEqual(datalist, data)
612612

613613

614+
class TestServerLock(TestServer):
615+
616+
def setUp(self):
617+
super(TestServerLock, self).setUp()
618+
619+
# Get the command object to test
620+
self.cmd = server.LockServer(self.app, None)
621+
622+
# Set methods to be tested.
623+
self.methods = {
624+
'lock': None,
625+
}
626+
627+
def test_server_lock_one_server(self):
628+
self.run_method_with_servers('lock', 1)
629+
630+
def test_server_lock_multi_servers(self):
631+
self.run_method_with_servers('lock', 3)
632+
633+
614634
class TestServerPause(TestServer):
615635

616636
def setUp(self):

0 commit comments

Comments
 (0)