@@ -30,7 +30,10 @@ def test_cluster(self):
3030 url = '/api/clusters'
3131 options = {'key' : 'val' }
3232 body = {'id' : 'autotest' , 'domain' : 'autotest.local' , 'type' : 'mock' ,
33- 'hosts' : 'host1,host2' , 'auth' : 'base64string' , 'options' : options }
33+ 'hosts' : 'host1;host2' , 'auth' : 'base64string' , 'options' : options }
34+ response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
35+ self .assertEqual (response .status_code , 400 )
36+ body ['hosts' ] = 'host1,host2'
3437 response = self .client .post (url , json .dumps (body ), content_type = 'application/json' )
3538 self .assertEqual (response .status_code , 201 )
3639 cluster_id = response .data ['id' ] # noqa
@@ -54,7 +57,15 @@ def test_cluster(self):
5457 url = '/api/clusters/{cluster_id}' .format (** locals ())
5558 response = self .client .get (url )
5659 self .assertEqual (response .status_code , 200 )
57- new_hosts , new_options = 'host2,host3' , {'key' : 'val2' }
60+ # regression test for https://github.com/deis/deis/issues/1552
61+ body = {'hosts' : 'host2 host3' }
62+ response = self .client .patch (url , json .dumps (body ), content_type = 'application/json' )
63+ self .assertEqual (response .status_code , 400 )
64+ body = {'hosts' : 'host2;host3' }
65+ response = self .client .patch (url , json .dumps (body ), content_type = 'application/json' )
66+ self .assertEqual (response .status_code , 400 )
67+ # update cluster hosts
68+ new_hosts , new_options = 'host2.domain,host3.sub.domain,127.0.0.1' , {'key' : 'val2' }
5869 body = {'hosts' : new_hosts , 'options' : new_options }
5970 response = self .client .patch (url , json .dumps (body ), content_type = 'application/json' )
6071 self .assertEqual (response .status_code , 200 )
0 commit comments