Esempio n. 1
0
def test_data_type_check():
    cell = Cell(None, 'A', 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value('.0e000')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('-0.e-0')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('1E')
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 2
0
def test_data_type_check():
    cell = Cell(None, "A", 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value(".0e000")
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value("-0.e-0")
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value("1E")
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 3
0
def test_data_type_check():
    cell = Cell(None, 'A', 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value('.0e000')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('-0.e-0')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('1E')
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 4
0
def test_data_type_check():
    ws = build_dummy_worksheet()
    cell = Cell(ws, 'A', 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value('.0e000')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('-0.e-0')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('1E')
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 5
0
def test_data_type_check():
    ws = build_dummy_worksheet()
    cell = Cell(ws, 'A', 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value('.0e000')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('-0.e-0')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('1E')
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 6
0
def test_data_type_check():
    ws = build_dummy_worksheet()
    cell = Cell(ws, "A", 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value(".0e000")
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value("-0.e-0")
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value("1E")
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 7
0
def test_data_type_check():
    class Ws(object):
            encoding = 'utf-8'
    cell = Cell(Ws(), 'A', 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value('.0e000')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('-0.e-0')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('1E')
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 8
0
def test_data_type_check():
    class Ws(object):
        encoding = 'utf-8'

    cell = Cell(Ws(), 'A', 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value('.0e000')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('-0.e-0')
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value('1E')
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 9
0
def test_data_type_check():
    class Ws(object):
        encoding = "utf-8"

    cell = Cell(Ws(), "A", 1)
    cell.bind_value(None)
    eq_(Cell.TYPE_NULL, cell._data_type)

    cell.bind_value(".0e000")
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value("-0.e-0")
    eq_(Cell.TYPE_NUMERIC, cell._data_type)

    cell.bind_value("1E")
    eq_(Cell.TYPE_STRING, cell._data_type)
Esempio n. 10
0
def test_data_type_check(value, datatype):
    ws = build_dummy_worksheet()
    ws.parent._guess_types = True
    cell = Cell(ws, 'A', 1)
    cell.bind_value(value)
    assert cell.data_type == datatype
Esempio n. 11
0
def test_data_type_check(value, datatype):
    ws = build_dummy_worksheet()
    ws.parent._guess_types = True
    cell = Cell(ws, 'A', 1)
    cell.bind_value(value)
    assert cell.data_type == datatype