Exemple #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}, ())
Exemple #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}, ())
Exemple #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}, ())
Exemple #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))
Exemple #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))
Exemple #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))
Exemple #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'))
Exemple #8
0
def test_split_token():
    assert split_token(('foo', 'bar')) == (set(), ('foo', 'bar'))
    assert split_token(()) == (set(), ())
    assert split_token('') == (set(), ('',))
Exemple #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'))
Exemple #10
0
def test_split_token():
    assert split_token(('foo', 'bar')) == (set(), ('foo', 'bar'))
    assert split_token(()) == (set(), ())
    assert split_token('') == (set(), ('', ))
Exemple #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"))
Exemple #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(), ("",))