Exemplo n.º 1
0
def test_split_token_not_modified():
    with pytest.raises(ValueError):
        split_token((NOT_MODIFIED, 'foo', 'bar'))
    with pytest.raises(ValueError):
        split_token((NOT_MODIFIED, INHERIT))
    with pytest.raises(ValueError):
        split_token((INHERIT, NOT_MODIFIED))
    assert split_token(NOT_MODIFIED) == ({NOT_MODIFIED}, ())
    assert split_token((NOT_MODIFIED, )) == ({NOT_MODIFIED}, ())
Exemplo n.º 2
0
def test_split_token_not_modified():
    with pytest.raises(ValueError):
        split_token((NOT_MODIFIED, 'foo', 'bar'))
    with pytest.raises(ValueError):
        split_token((NOT_MODIFIED, INHERIT))
    with pytest.raises(ValueError):
        split_token((INHERIT, NOT_MODIFIED))
    assert split_token(NOT_MODIFIED) == ({NOT_MODIFIED}, ())
    assert split_token((NOT_MODIFIED,)) == ({NOT_MODIFIED}, ())
Exemplo n.º 3
0
def test_split_token_not_modified():
    with pytest.deprecated_call():
        with pytest.raises(ValueError):
            split_token((F_NOT_MODIFIED, "foo", "bar"))
        with pytest.raises(ValueError):
            split_token((F_NOT_MODIFIED, F_INHERIT))
        with pytest.raises(ValueError):
            split_token((F_INHERIT, F_NOT_MODIFIED))
        assert split_token(F_NOT_MODIFIED) == ({F_NOT_MODIFIED}, ())
        assert split_token((F_NOT_MODIFIED,)) == ({F_NOT_MODIFIED}, ())
Exemplo n.º 4
0
def test_split_token_duplicate():
    with pytest.raises(ValueError):
        split_token((NOT_MODIFIED, NOT_MODIFIED))
    with pytest.raises(ValueError):
        split_token((INHERIT, INHERIT))
    with pytest.raises(ValueError):
        split_token((INHERIT, NOT_MODIFIED, INHERIT))
Exemplo n.º 5
0
def test_split_token_duplicate():
    with pytest.raises(ValueError):
        split_token((NOT_MODIFIED, NOT_MODIFIED))
    with pytest.raises(ValueError):
        split_token((INHERIT, INHERIT))
    with pytest.raises(ValueError):
        split_token((INHERIT, NOT_MODIFIED, INHERIT))
Exemplo n.º 6
0
def test_split_token_duplicate():
    with pytest.deprecated_call():
        with pytest.raises(ValueError):
            split_token((F_NOT_MODIFIED, F_NOT_MODIFIED))
        with pytest.raises(ValueError):
            split_token((F_INHERIT, F_INHERIT))
        with pytest.raises(ValueError):
            split_token((F_INHERIT, F_NOT_MODIFIED, F_INHERIT))
Exemplo n.º 7
0
def test_split_token_inherit():
    assert split_token(INHERIT) == ({INHERIT}, ())
    assert split_token((INHERIT,)) == ({INHERIT}, ())
    assert split_token((INHERIT, 'foo', 'bar')) == ({INHERIT}, ('foo', 'bar'))
Exemplo n.º 8
0
def test_split_token():
    assert split_token(('foo', 'bar')) == (set(), ('foo', 'bar'))
    assert split_token(()) == (set(), ())
    assert split_token('') == (set(), ('',))
Exemplo n.º 9
0
def test_split_token_inherit():
    assert split_token(INHERIT) == ({INHERIT}, ())
    assert split_token((INHERIT, )) == ({INHERIT}, ())
    assert split_token((INHERIT, 'foo', 'bar')) == ({INHERIT}, ('foo', 'bar'))
Exemplo n.º 10
0
def test_split_token():
    assert split_token(('foo', 'bar')) == (set(), ('foo', 'bar'))
    assert split_token(()) == (set(), ())
    assert split_token('') == (set(), ('', ))
Exemplo n.º 11
0
def test_split_token_inherit():
    with pytest.deprecated_call():
        assert split_token(F_INHERIT) == ({F_INHERIT}, ())
        assert split_token((F_INHERIT,)) == ({F_INHERIT}, ())
        assert split_token((F_INHERIT, "foo", "bar")) == ({F_INHERIT}, ("foo", "bar"))
Exemplo n.º 12
0
def test_split_token():
    with pytest.deprecated_call():
        assert split_token(("foo", "bar")) == (set(), ("foo", "bar"))
        assert split_token(()) == (set(), ())
        assert split_token("") == (set(), ("",))