def create_delete_connection_test(): client = DSSClient(host, apiKey) count = len(client.list_connections()) connection = client.create_connection("toto", "HDFS") eq_(count + 1, len(client.list_connections())) connection.delete() eq_(count, len(client.list_connections()))
def get_set_connection_test(): client = DSSClient(host, apiKey) connection = client.create_connection("toto", "HDFS") desc = connection.get_definition() desc['usableBy'] = 'ALLOWED' desc['allowedGroups'] = ['a','b'] connection.set_definition(desc) desc2 = connection.get_definition() eq_('ALLOWED', desc2['usableBy']) connection.delete()
def get_set_connection_test(): client = DSSClient(host, apiKey) connection = client.create_connection("toto", "HDFS") desc = connection.get_definition() desc['usableBy'] = 'ALLOWED' desc['allowedGroups'] = ['a', 'b'] connection.set_definition(desc) desc2 = connection.get_definition() eq_('ALLOWED', desc2['usableBy']) connection.delete()