# 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 PageSetup
global_api = None

class TestCellsPageSetupApi(unittest.TestCase):
    """ CellsPageSetupApi 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_page_setup_delete_header_footer(self):
        """
        Test case for cells_page_setup_delete_header_footer

        clear header footer
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        index = 0         
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_delete_header_footer(name, sheet_name,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_page_setup_get_footer(self):
        """
        Test case for cells_page_setup_get_footer

        get page footer information
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        index = 0         
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_get_footer(name, sheet_name,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_page_setup_get_header(self):
        """
        Test case for cells_page_setup_get_header

        get page header information
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        index = 0         
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_get_header(name, sheet_name,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_page_setup_get_page_setup(self):
        """
        Test case for cells_page_setup_get_page_setup

        Get Page Setup information.             
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        index = 0         
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_get_page_setup(name, sheet_name,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_page_setup_post_footer(self):
        """
        Test case for cells_page_setup_post_footer

        update  page footer information 
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        section = 0    
        script = "test"
        isFirstPage = 'true'     
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_post_footer(name, sheet_name,section, script ,  isFirstPage,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_page_setup_post_header(self):
        """
        Test case for cells_page_setup_post_header

        update  page header information 
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        section = 1    
        script = "test"
        isFirstPage = True
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_post_header(name, sheet_name,section, script ,  isFirstPage,folder=folder)
        self.assertEqual(result.code,200)
        pass

    def test_cells_page_setup_post_page_setup(self):
        """
        Test case for cells_page_setup_post_page_setup

        Update Page Setup information.
        """
        name ='Book1.xlsx'
        sheet_name ='Sheet1'
        pageSetup = PageSetup() 
        pageSetup.black_and_white = True
        folder = "PythonTest"
        result = AuthUtil.Ready(self.api, name, folder)
        self.assertTrue(len(result.uploaded)>0) 
        result = self.api.cells_page_setup_post_page_setup(name, sheet_name, page_setup=pageSetup,folder=folder)
        self.assertEqual(result.code,200)
        pass


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