Пример #1
0
def test_corner_case():
    """tricky corner case where some variable may have a
    name attribute
    """
    class Person:
        name = "hello"

    p = Person()
    with pytest.raises(TypeError):
        _, _, _ = separate_entities([p])
Пример #2
0
def test_name_collision():
    with pytest.raises(SmartSimError):
        _, _, _ = separate_entities([model, model_2])
Пример #3
0
def test_two_orc():
    with pytest.raises(SmartSimError):
        _, _, _orc = separate_entities([orc, orc_1])
Пример #4
0
def test_separate_type():
    with pytest.raises(TypeError):
        _, _, _ = separate_entities([1, 2, 3])
Пример #5
0
def test_separate():
    ent, ent_list, _orc = separate_entities([model, ensemble, orc])
    assert ent[0] == model
    assert ent_list[0] == ensemble
    assert _orc == orc