# coding: utf-8

"""
    Web API Swagger specification

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: 1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import os
import sys
import unittest
import warnings

ABSPATH = os.path.abspath(os.path.realpath(os.path.dirname(__file__)) + "/..")
sys.path.append(ABSPATH)
import asposecellscloud
from asposecellscloud.rest import ApiException
from asposecellscloud.apis.cells_api import CellsApi
import AuthUtil
from asposecellscloud.models import Shape
global_api = None

class TestCellsShapesApi(unittest.TestCase):
    """ CellsShapesApi unit test stubs """

    def setUp(self):
        warnings.simplefilter('ignore', ResourceWarning)
        global global_api
        if global_api is None:
           global_api = asposecellscloud.apis.cells_api.CellsApi(AuthUtil.GetClientId(),AuthUtil.GetClientSecret(),"v3.0",AuthUtil.GetBaseUrl())
        self.api = global_api

    def tearDown(self):
        pass

    def test_cells_shapes_delete_worksheet_shape(self):
        """
        Test case for cells_shapes_delete_worksheet_shape

        Delete a shape in worksheet
        """
        name ='Book1.xlsx'  
        sheet_name ='Sheet1'    
        shapeindex = 0       
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_shapes_delete_worksheet_shape(name, sheet_name, shapeindex,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_shapes_delete_worksheet_shapes(self):
        """
        Test case for cells_shapes_delete_worksheet_shapes

        delete all shapes in worksheet
        """
        name ='Book1.xlsx'  
        sheet_name ='Sheet1'    
        shapeindex = 0       
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_shapes_delete_worksheet_shapes(name, sheet_name, folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_shapes_get_worksheet_shape(self):
        """
        Test case for cells_shapes_get_worksheet_shape

        Get worksheet shape
        """
        name ='Book1.xlsx'  
        sheet_name ='Sheet1'    
        shapeindex = 0       
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_shapes_get_worksheet_shape(name, sheet_name, shapeindex,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_shapes_get_worksheet_shapes(self):
        """
        Test case for cells_shapes_get_worksheet_shapes

        Get worksheet shapes 
        """
        name ='Book1.xlsx'  
        sheet_name ='Sheet1'    
        shapeindex = 0       
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_shapes_get_worksheet_shapes(name, sheet_name, folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_shapes_post_worksheet_shape(self):
        """
        Test case for cells_shapes_post_worksheet_shape

        Update a shape in worksheet
        """
        name ='Book1.xlsx'  
        sheet_name ='Sheet1'    
        shapeindex = 0   
        dto = Shape()
        dto.lower_right_column = 10
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_shapes_post_worksheet_shape(name, sheet_name, shapeindex,dto=dto,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_shapes_put_worksheet_shape(self):
        """
        Test case for cells_shapes_put_worksheet_shape

        Add shape in worksheet
        """
        name ='Book1.xlsx'  
        sheet_name ='Sheet1'    
        drawingType= "button"  
        upperLeftRow=1 
        upperLeftColumn= 1 
        top=10
        left= 10
        width= 100 
        height= 90 
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_shapes_put_worksheet_shape(name, sheet_name,drawing_type=drawingType,upper_left_row=upperLeftRow,upper_left_column=upperLeftColumn, top=top, left=left, width=width, height=    height,folder=folder)
        self.assertEqual(result.code,200)
        pass


if __name__ == '__main__':
    unittest.main()
