def test_submodule_operations():
    m = run_mod(
    """
    #lang pycket
    (module test-sub-module pycket
      (provide a)
      (define a 1))
    (require (submod "." test-sub-module))
    (define b (+ a a))
    """)
    assert len(m.submodules) == 1

    # properties concerning relationships between modules and submodules
    b   = m.defs[W_Symbol.make("b")]
    sub = m.resolve_submodule_path(["test-sub-module"])
    assert sub.parent is m
    assert sub in m.submodules
    assert m.root_module() is m
    assert sub.root_module() is m

    a   = sub.defs[W_Symbol.make("a")]
    assert isinstance(b, W_Integer) and b.value == 2
    assert isinstance(a, W_Integer) and a.value == 1
dataset/ETHPy150Open samth/pycket/pycket/test/test_mod.py/test_submodule_operations/original