Add eval tests to RHEL %py_provides Obsoletes functionality
This commit is contained in:
parent
5d7727c2aa
commit
5547a87f0b
@ -168,66 +168,91 @@ def test_python_provide_doubleuse():
|
|||||||
assert len(set(lines)) == 3
|
assert len(set(lines)) == 3
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_python():
|
@pytest.mark.parametrize('rhel', [None, 10])
|
||||||
lines = rpm_eval('%py_provides python-foo', version='6', release='1.fc66')
|
def test_py_provides_python(rhel):
|
||||||
|
lines = rpm_eval('%py_provides python-foo', version='6', release='1.fc66', rhel=rhel)
|
||||||
assert 'Provides: python-foo = 6-1.fc66' in lines
|
assert 'Provides: python-foo = 6-1.fc66' in lines
|
||||||
assert len(lines) == 1
|
assert len(lines) == 1
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_whatever():
|
@pytest.mark.parametrize('rhel', [None, 12])
|
||||||
lines = rpm_eval('%py_provides whatever', version='6', release='1.fc66')
|
def test_py_provides_whatever(rhel):
|
||||||
|
lines = rpm_eval('%py_provides whatever', version='6', release='1.fc66', rhel=rhel)
|
||||||
assert 'Provides: whatever = 6-1.fc66' in lines
|
assert 'Provides: whatever = 6-1.fc66' in lines
|
||||||
assert len(lines) == 1
|
assert len(lines) == 1
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_python3():
|
@pytest.mark.parametrize('rhel', [None, 9])
|
||||||
lines = rpm_eval('%py_provides python3-foo', version='6', release='1.fc66')
|
def test_py_provides_python3(rhel):
|
||||||
|
lines = rpm_eval('%py_provides python3-foo', version='6', release='1.fc66', rhel=rhel)
|
||||||
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
||||||
assert 'Provides: python-foo = 6-1.fc66' in lines
|
assert 'Provides: python-foo = 6-1.fc66' in lines
|
||||||
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
||||||
|
if rhel:
|
||||||
|
assert f'Obsoletes: python{X_Y}-foo < 6-1.fc66' in lines
|
||||||
|
assert len(lines) == 4
|
||||||
|
else:
|
||||||
assert len(lines) == 3
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_python3_epoched():
|
@pytest.mark.parametrize('rhel', [None, 13])
|
||||||
lines = rpm_eval('%py_provides python3-foo', epoch='1', version='6', release='1.fc66')
|
def test_py_provides_python3_epoched(rhel):
|
||||||
|
lines = rpm_eval('%py_provides python3-foo', epoch='1', version='6', release='1.fc66', rhel=rhel)
|
||||||
assert 'Provides: python3-foo = 1:6-1.fc66' in lines
|
assert 'Provides: python3-foo = 1:6-1.fc66' in lines
|
||||||
assert 'Provides: python-foo = 1:6-1.fc66' in lines
|
assert 'Provides: python-foo = 1:6-1.fc66' in lines
|
||||||
assert f'Provides: python{X_Y}-foo = 1:6-1.fc66' in lines
|
assert f'Provides: python{X_Y}-foo = 1:6-1.fc66' in lines
|
||||||
|
if rhel:
|
||||||
|
assert f'Obsoletes: python{X_Y}-foo < 1:6-1.fc66' in lines
|
||||||
|
assert len(lines) == 4
|
||||||
|
else:
|
||||||
assert len(lines) == 3
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_python3X():
|
@pytest.mark.parametrize('rhel', [None, 13])
|
||||||
lines = rpm_eval(f'%py_provides python{X_Y}-foo', version='6', release='1.fc66')
|
def test_py_provides_python3X(rhel):
|
||||||
|
lines = rpm_eval(f'%py_provides python{X_Y}-foo', version='6', release='1.fc66', rhel=rhel)
|
||||||
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
||||||
assert 'Provides: python-foo = 6-1.fc66' in lines
|
assert 'Provides: python-foo = 6-1.fc66' in lines
|
||||||
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
||||||
assert len(lines) == 3
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_python3X_epoched():
|
@pytest.mark.parametrize('rhel', [None, 27])
|
||||||
lines = rpm_eval(f'%py_provides python{X_Y}-foo', epoch='1', version='6', release='1.fc66')
|
def test_py_provides_python3X_epoched(rhel):
|
||||||
|
lines = rpm_eval(f'%py_provides python{X_Y}-foo', epoch='1', version='6', release='1.fc66', rhel=rhel)
|
||||||
assert f'Provides: python{X_Y}-foo = 1:6-1.fc66' in lines
|
assert f'Provides: python{X_Y}-foo = 1:6-1.fc66' in lines
|
||||||
assert 'Provides: python-foo = 1:6-1.fc66' in lines
|
assert 'Provides: python-foo = 1:6-1.fc66' in lines
|
||||||
assert 'Provides: python3-foo = 1:6-1.fc66' in lines
|
assert 'Provides: python3-foo = 1:6-1.fc66' in lines
|
||||||
assert len(lines) == 3
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_doubleuse():
|
@pytest.mark.parametrize('rhel', [None, 2])
|
||||||
|
def test_py_provides_doubleuse(rhel):
|
||||||
lines = rpm_eval('%{py_provides python3-foo}%{py_provides python3-foo}',
|
lines = rpm_eval('%{py_provides python3-foo}%{py_provides python3-foo}',
|
||||||
version='6', release='1.fc66')
|
version='6', release='1.fc66', rhel=rhel)
|
||||||
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
||||||
assert 'Provides: python-foo = 6-1.fc66' in lines
|
assert 'Provides: python-foo = 6-1.fc66' in lines
|
||||||
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
||||||
|
if rhel:
|
||||||
|
assert f'Obsoletes: python{X_Y}-foo < 6-1.fc66' in lines
|
||||||
|
assert len(lines) == 8
|
||||||
|
assert len(set(lines)) == 4
|
||||||
|
else:
|
||||||
assert len(lines) == 6
|
assert len(lines) == 6
|
||||||
assert len(set(lines)) == 3
|
assert len(set(lines)) == 3
|
||||||
|
|
||||||
|
|
||||||
def test_py_provides_with_evr():
|
@pytest.mark.parametrize('rhel', [None, 2])
|
||||||
|
def test_py_provides_with_evr(rhel):
|
||||||
lines = rpm_eval('%py_provides python3-foo 123',
|
lines = rpm_eval('%py_provides python3-foo 123',
|
||||||
version='6', release='1.fc66')
|
version='6', release='1.fc66', rhel=rhel)
|
||||||
assert 'Provides: python3-foo = 123' in lines
|
assert 'Provides: python3-foo = 123' in lines
|
||||||
assert 'Provides: python-foo = 123' in lines
|
assert 'Provides: python-foo = 123' in lines
|
||||||
assert f'Provides: python{X_Y}-foo = 123' in lines
|
assert f'Provides: python{X_Y}-foo = 123' in lines
|
||||||
|
if rhel:
|
||||||
|
assert f'Obsoletes: python{X_Y}-foo < 123' in lines
|
||||||
|
assert len(lines) == 4
|
||||||
|
else:
|
||||||
assert len(lines) == 3
|
assert len(lines) == 3
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user