# Path: openpyxl/tests/helper.py
# DATADIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'test_data'))
# 
# Path: openpyxl/reader/iter_worksheet.py
# def get_range_boundaries(range_string, row = 0, column = 0):
# 
#     if ':' in range_string:
#         min_range, max_range = range_string.split(':')
#         min_col, min_row = coordinate_from_string(min_range)
#         max_col, max_row = coordinate_from_string(max_range)
# 
#         min_col = column_index_from_string(min_col) + column
#         max_col = column_index_from_string(max_col) + column
#         min_row += row
#         max_row += row
# 
#     else:
#         min_col, min_row = coordinate_from_string(range_string)
#         min_col = column_index_from_string(min_col)
#         max_col = min_col + 1
#         max_row = min_row 
# 
#     return (min_col, min_row, max_col, max_row)
# 
# Path: openpyxl/reader/excel.py
# def load_workbook(filename, use_iterators = False):
#     """Open the given filename and return the workbook
# 
#     :param filename: the path to open
#     :type filename: string
#     
#     :param use_iterators: use lazy load for cells
#     :type use_iterators: bool
# 
#     :rtype: :class:`openpyxl.workbook.Workbook`
#     
#     .. note::
#         
#         When using lazy load, all worksheets will be :class:`openpyxl.reader.iter_worksheet.IterableWorksheet`
#         and the returned workbook will be read-only. 
# 
#     """
# 
#     if isinstance(filename, file):
#         # fileobject must have been opened with 'rb' flag
#         # it is required by zipfile
#         if 'b' not in filename.mode:
#             raise OpenModeError("File-object must be opened in binary mode")
# 
#     try:
#         archive = ZipFile(filename, 'r', ZIP_DEFLATED)
#     except (BadZipfile, RuntimeError, IOError, ValueError), e:
#         raise InvalidFileException(unicode(e))
#     wb = Workbook()
# 
#     if use_iterators:
#         wb._set_optimized_read()
# 
#     try:
#         _load_workbook(wb, archive, filename, use_iterators)
#     except KeyError, e:
#         raise InvalidFileException(unicode(e))
#     finally:
#         archive.close()
#     return wb


from nose.tools import eq_, raises, assert_raises
from openpyxl.tests.helper import DATADIR
from openpyxl.reader.iter_worksheet import get_range_boundaries
from openpyxl.reader.excel import load_workbook
import os.path as osp
import datetime

# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# @license: http://www.opensource.org/licenses/mit-license.php
# @author: Eric Gazoni


class TestWorksheet(object):

    workbook_name = osp.join(DATADIR, 'genuine', 'empty.xlsx')

class TestText(TestWorksheet):
    sheet_name = 'Sheet1 - Text'

    expected = [['This is cell A1 in Sheet 1', None, None, None, None, None, None],
                [None, None, None, None, None, None, None],

# Path: openpyxl/tests/helper.py
# DATADIR = os.path.abspath(os.path.join(os.path.dirname(__file__), 'test_data'))
# 
# Path: openpyxl/reader/iter_worksheet.py
# def get_range_boundaries(range_string, row = 0, column = 0):
# 
#     if ':' in range_string:
#         min_range, max_range = range_string.split(':')
#         min_col, min_row = coordinate_from_string(min_range)
#         max_col, max_row = coordinate_from_string(max_range)
# 
#         min_col = column_index_from_string(min_col) + column
#         max_col = column_index_from_string(max_col) + column
#         min_row += row
#         max_row += row
# 
#     else:
#         min_col, min_row = coordinate_from_string(range_string)
#         min_col = column_index_from_string(min_col)
#         max_col = min_col + 1
#         max_row = min_row 
# 
#     return (min_col, min_row, max_col, max_row)
# 
# Path: openpyxl/reader/excel.py
# def load_workbook(filename, use_iterators = False):
#     """Open the given filename and return the workbook
# 
#     :param filename: the path to open
#     :type filename: string
#     
#     :param use_iterators: use lazy load for cells
#     :type use_iterators: bool
# 
#     :rtype: :class:`openpyxl.workbook.Workbook`
#     
#     .. note::
#         
#         When using lazy load, all worksheets will be :class:`openpyxl.reader.iter_worksheet.IterableWorksheet`
#         and the returned workbook will be read-only. 
# 
#     """
# 
#     if isinstance(filename, file):
#         # fileobject must have been opened with 'rb' flag
#         # it is required by zipfile
#         if 'b' not in filename.mode:
#             raise OpenModeError("File-object must be opened in binary mode")
# 
#     try:
#         archive = ZipFile(filename, 'r', ZIP_DEFLATED)
#     except (BadZipfile, RuntimeError, IOError, ValueError), e:
#         raise InvalidFileException(unicode(e))
#     wb = Workbook()
# 
#     if use_iterators:
#         wb._set_optimized_read()
# 
#     try:
#         _load_workbook(wb, archive, filename, use_iterators)
#     except KeyError, e:
#         raise InvalidFileException(unicode(e))
#     finally:
#         archive.close()
#     return wb


# Path: openpyxl/tests/test_iter.py
from nose.tools import eq_, raises, assert_raises
from openpyxl.tests.helper import DATADIR
from openpyxl.reader.iter_worksheet import get_range_boundaries
from openpyxl.reader.excel import load_workbook
import os.path as osp
import datetime

# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# @license: http://www.opensource.org/licenses/mit-license.php
# @author: Eric Gazoni


class TestWorksheet(object):

    workbook_name = osp.join(DATADIR, 'genuine', 'empty.xlsx')

class TestText(TestWorksheet):
    sheet_name = 'Sheet1 - Text'

    expected = [['This is cell A1 in Sheet 1', None, None, None, None, None, None],
                [None, None, None, None, None, None, None],

                [None, None, None, None, None, None, None],
