Example #1
0
def test_pack_mixed_object():
    obj = ScriptDataObject()

    # Preserves insertion order
    obj["number"] = 123
    obj["string"] = "foobar"
    obj["bool"] = True

    assert ScriptDataObject.pack(obj) == MIXED_VALUES
def test_pack_mixed_object():
    obj = ScriptDataObject()

    # Preserves insertion order
    obj["number"] = 123
    obj["string"] = "foobar"
    obj["bool"] = True

    assert ScriptDataObject.pack(obj) == MIXED_VALUES
Example #3
0
def test_pack_booleans_object():
    assert ScriptDataObject.pack(ScriptDataObject(foo=True)) == BOOLEAN_VALUE
Example #4
0
def test_pack_strings_object():
    assert ScriptDataObject.pack(ScriptDataObject(foo="bar")) == STRING_VALUE
Example #5
0
def test_pack_numbers_object():
    assert ScriptDataObject.pack(ScriptDataObject(foo=123)) == NUMBER_VALUE
Example #6
0
def test_pack_empty_object():
    assert ScriptDataObject.pack(ScriptDataObject()) == EMPTY_OBJECT
def test_pack_booleans_object():
    assert ScriptDataObject.pack(ScriptDataObject(foo=True)) == BOOLEAN_VALUE
def test_pack_strings_object():
    assert ScriptDataObject.pack(ScriptDataObject(foo="bar")) == STRING_VALUE
def test_pack_numbers_object():
    assert ScriptDataObject.pack(ScriptDataObject(foo=123)) == NUMBER_VALUE
def test_pack_empty_object():
    assert ScriptDataObject.pack(ScriptDataObject()) == EMPTY_OBJECT