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)
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)
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)
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)
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)
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)
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