Exemplo n.º 1
0
def test_annotation_suppression():
    if is_pypy:
        return

    ion_value = loads(dumps(IonPyInt.from_value(IonType.INT, 123, six.text_type("Annotation"))))
    assert isinstance(ion_value, IonPyInt) and ion_value.ion_type == IonType.INT
    json_string = json.dumps(ion_value, cls=IonToJSONEncoder)
    assert json_string == '123'
Exemplo n.º 2
0
 IonPyNull.from_value(IonType.NULL, None),
 IonPyNull.from_value(IonType.BOOL, None),
 IonPyNull.from_value(IonType.INT, None),
 IonPyNull.from_value(IonType.FLOAT, None),
 IonPyNull.from_value(IonType.DECIMAL, None),
 IonPyNull.from_value(IonType.TIMESTAMP, None),
 IonPyNull.from_value(IonType.SYMBOL, None),
 IonPyNull.from_value(IonType.STRING, None),
 IonPyNull.from_value(IonType.CLOB, None),
 IonPyNull.from_value(IonType.BLOB, None),
 IonPyNull.from_value(IonType.LIST, None),
 IonPyNull.from_value(IonType.SEXP, None),
 IonPyNull.from_value(IonType.STRUCT, None),
 True,
 False,
 IonPyInt.from_value(IonType.BOOL, 0),
 IonPyInt.from_value(IonType.BOOL, 1),
 0,
 -1,
 1.23,
 1.23e4,
 -1.23,
 -1.23e-4,
 Decimal(0),
 Decimal('-1.23'),
 datetime(year=1,
          month=1,
          day=1,
          tzinfo=OffsetTZInfo(timedelta(minutes=-1))),
 u'',
 u'abc',
Exemplo n.º 3
0
 IonPyNull.from_value(IonType.NULL, None),
 IonPyNull.from_value(IonType.BOOL, None),
 IonPyNull.from_value(IonType.INT, None),
 IonPyNull.from_value(IonType.FLOAT, None),
 IonPyNull.from_value(IonType.DECIMAL, None),
 IonPyNull.from_value(IonType.TIMESTAMP, None),
 IonPyNull.from_value(IonType.SYMBOL, None),
 IonPyNull.from_value(IonType.STRING, None),
 IonPyNull.from_value(IonType.CLOB, None),
 IonPyNull.from_value(IonType.BLOB, None),
 IonPyNull.from_value(IonType.LIST, None),
 IonPyNull.from_value(IonType.SEXP, None),
 IonPyNull.from_value(IonType.STRUCT, None),
 True,
 False,
 IonPyInt.from_value(IonType.BOOL, 0),
 IonPyInt.from_value(IonType.BOOL, 1),
 0,
 -1,
 1.23,
 1.23e4,
 -1.23,
 -1.23e-4,
 Decimal(0),
 Decimal('-1.23'),
 datetime(year=1, month=1, day=1, tzinfo=OffsetTZInfo(timedelta(minutes=-1))),
 u'',
 u'abc',
 u'abcdefghijklmno',
 u'a\U0001f4a9c',
 u'a\u3000\x20c',