How to use the barril._foundation.klass.IsInstance function in barril

To help you get started, we’ve selected a few barril examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
assert set(AllBasesNames(D)) == {"C", "B", "A", "object"}
    assert set(AllBasesNames(AlphaC)) == {"Alpha", "object", "C", "B", "A"}

    assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
class Alpha:
        pass

    class AlphaC(Alpha, C):
        pass

    assert set(AllBasesNames(A)) == {"object"}
    assert set(AllBasesNames(B)) == {"A", "object"}
    assert set(AllBasesNames(C)) == {"B", "A", "object"}
    assert set(AllBasesNames(D)) == {"C", "B", "A", "object"}
    assert set(AllBasesNames(AlphaC)) == {"Alpha", "object", "C", "B", "A"}

    assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
class AlphaC(Alpha, C):
        pass

    assert set(AllBasesNames(A)) == {"object"}
    assert set(AllBasesNames(B)) == {"A", "object"}
    assert set(AllBasesNames(C)) == {"B", "A", "object"}
    assert set(AllBasesNames(D)) == {"C", "B", "A", "object"}
    assert set(AllBasesNames(AlphaC)) == {"Alpha", "object", "C", "B", "A"}

    assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
assert set(AllBasesNames(A)) == {"object"}
    assert set(AllBasesNames(B)) == {"A", "object"}
    assert set(AllBasesNames(C)) == {"B", "A", "object"}
    assert set(AllBasesNames(D)) == {"C", "B", "A", "object"}
    assert set(AllBasesNames(AlphaC)) == {"Alpha", "object", "C", "B", "A"}

    assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
assert set(AllBasesNames(C)) == {"B", "A", "object"}
    assert set(AllBasesNames(D)) == {"C", "B", "A", "object"}
    assert set(AllBasesNames(AlphaC)) == {"Alpha", "object", "C", "B", "A"}

    assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
def testIsInstance():
    assert IsInstance(_C(), "_B")
    assert IsInstance(_C(), ("_B",))
    assert not IsInstance(_C(), ("_A",))
    assert IsInstance(_C(), ("_A", "_B"))
    assert not IsInstance(_C(), ("_A", "_D"))
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
class AlphaC(Alpha, C):
        pass

    assert set(AllBasesNames(A)) == {"object"}
    assert set(AllBasesNames(B)) == {"A", "object"}
    assert set(AllBasesNames(C)) == {"B", "A", "object"}
    assert set(AllBasesNames(D)) == {"C", "B", "A", "object"}
    assert set(AllBasesNames(AlphaC)) == {"Alpha", "object", "C", "B", "A"}

    assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
assert IsInstance(A(), "object")
    assert IsInstance(A(), "A")
    assert IsInstance(B(), "object")
    assert IsInstance(B(), "A")
    assert IsInstance(B(), "B")
    assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")
github ESSS / barril / src / barril / _foundation / _tests / test_klass.py View on Github external
assert IsInstance(C(), "object")
    assert IsInstance(C(), "A")
    assert IsInstance(C(), "B")
    assert IsInstance(C(), "C")
    assert IsInstance(AlphaC(), "object")
    assert IsInstance(AlphaC(), "A")
    assert IsInstance(AlphaC(), A)
    assert IsInstance(AlphaC(), "B")
    assert IsInstance(AlphaC(), "C")
    assert IsInstance(AlphaC(), "Alpha")
    assert IsInstance(AlphaC(), "AlphaC")
    assert IsInstance(AlphaC(), AlphaC)

    assert not IsInstance(AlphaC(), "Rubles")
    assert not IsInstance(A(), "B")
    assert not IsInstance(B(), "C")