def test_config_virtual_servers_add_v1(self, responses): base_response_v1(responses) responses_callback_v1(responses, 'Virtual%20Server%201') vss = VirtualServers(**stingray_args_v1) vs = vss.add('Virtual Server 1', 'Pool1', 8000) assert isinstance(vs, VirtualServer) assert vs.properties['basic']['pool'] == "Pool1" assert vs.properties['basic']['port'] == 8000 assert 'Virtual Server 1' in vss.virtual_servers
def test_config_virtual_servers_add_with_props(self, responses): base_response(responses) responses_callback(responses, 'Virtual%20Server%202') vss = VirtualServers(**stingray_args) vs = vss.add('Virtual Server 2', 'Pool2', 8000, basic=dict(connect_timeout=30), connection=dict(keepalive_timeout=30, timeoute=120)) assert isinstance(vs, VirtualServer) assert vs.properties['basic']['pool'] == "Pool2" assert vs.properties['basic']['connect_timeout'] == 30 assert vs.properties['connection']['keepalive_timeout'] == 30 assert vs.properties['connection']['timeoute'] == 120