Beispiel #1
0
def test_remove_ns(ns_sym: sym.Symbol,
                   ns_cache_with_existing_ns: atom.Atom[NamespaceMap]):
    assert len(list(ns_cache_with_existing_ns.deref().keys())) == 2
    ns = Namespace.remove(ns_sym)
    assert isinstance(ns, Namespace)
    assert ns.name == ns_sym.name
    assert len(list(ns_cache_with_existing_ns.deref().keys())) == 1
Beispiel #2
0
def test_remove_non_existent_ns(other_ns_sym: sym.Symbol,
                                ns_cache_with_existing_ns: patch):
    assert len(list(ns_cache_with_existing_ns.deref().keys())) == 2
    ns = Namespace.remove(other_ns_sym)
    assert ns is None
    assert len(list(ns_cache_with_existing_ns.deref().keys())) == 2
Beispiel #3
0
def test_cannot_remove_core(ns_cache: atom.Atom[NamespaceMap]):
    with pytest.raises(ValueError):
        Namespace.remove(sym.symbol("basilisp.core"))