Ejemplo n.º 1
0
def test_python_int():
    obj1 = 42
    filename = path("temp.py")
    saver = GenericSaver()
    saver.save(obj1, filename)
    loader = PythonLoader()
    obj2 = loader.load(filename)
    assert obj1 == obj2

    if filename.exists():
        os.remove(filename)
Ejemplo n.º 2
0
def test_python_int():
    obj1 = 42
    filename = path("temp.py")
    saver = GenericSaver()
    saver.save(obj1, filename)
    loader = PythonLoader()
    obj2 = loader.load(filename)
    assert obj1 == obj2

    if filename.exists():
        os.remove(filename)
Ejemplo n.º 3
0
def test_python_dict():
    obj1 = {'test1': True, 'test2': 42, 'test3': 'ok'}
    filename = path("temp.py")
    saver = GenericSaver()
    saver.save(obj1, filename)
    loader = PythonLoader()
    obj2 = loader.load(filename)
    assert obj1 == obj2

    if filename.exists():
        os.remove(filename)
Ejemplo n.º 4
0
def test_python_dict():
    obj1 = {'test1': True, 'test2': 42, 'test3': 'ok'}
    filename = path("temp.py")
    saver = GenericSaver()
    saver.save(obj1, filename)
    loader = PythonLoader()
    obj2 = loader.load(filename)
    assert obj1 == obj2

    if filename.exists():
        os.remove(filename)