Add eval tests to RHEL %py_provides Obsoletes functionality
Related: rhbz#1990421
This commit is contained in:
parent
e22e5600bd
commit
04145e4cdd
@ -168,67 +168,92 @@ def test_python_provide_doubleuse():
|
||||
assert len(set(lines)) == 3
|
||||
|
||||
|
||||
def test_py_provides_python():
|
||||
lines = rpm_eval('%py_provides python-foo', version='6', release='1.fc66')
|
||||
@pytest.mark.parametrize('rhel', [None, 10])
|
||||
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 len(lines) == 1
|
||||
|
||||
|
||||
def test_py_provides_whatever():
|
||||
lines = rpm_eval('%py_provides whatever', version='6', release='1.fc66')
|
||||
@pytest.mark.parametrize('rhel', [None, 12])
|
||||
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 len(lines) == 1
|
||||
|
||||
|
||||
def test_py_provides_python3():
|
||||
lines = rpm_eval('%py_provides python3-foo', version='6', release='1.fc66')
|
||||
@pytest.mark.parametrize('rhel', [None, 9])
|
||||
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: python-foo = 6-1.fc66' in lines
|
||||
assert f'Provides: python{X_Y}-foo = 6-1.fc66' in lines
|
||||
assert len(lines) == 3
|
||||
if rhel:
|
||||
assert f'Obsoletes: python{X_Y}-foo < 6-1.fc66' in lines
|
||||
assert len(lines) == 4
|
||||
else:
|
||||
assert len(lines) == 3
|
||||
|
||||
|
||||
def test_py_provides_python3_epoched():
|
||||
lines = rpm_eval('%py_provides python3-foo', epoch='1', version='6', release='1.fc66')
|
||||
@pytest.mark.parametrize('rhel', [None, 13])
|
||||
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: python-foo = 1:6-1.fc66' in lines
|
||||
assert f'Provides: python{X_Y}-foo = 1:6-1.fc66' in lines
|
||||
assert len(lines) == 3
|
||||
if rhel:
|
||||
assert f'Obsoletes: python{X_Y}-foo < 1:6-1.fc66' in lines
|
||||
assert len(lines) == 4
|
||||
else:
|
||||
assert len(lines) == 3
|
||||
|
||||
|
||||
def test_py_provides_python3X():
|
||||
lines = rpm_eval(f'%py_provides python{X_Y}-foo', version='6', release='1.fc66')
|
||||
@pytest.mark.parametrize('rhel', [None, 13])
|
||||
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 'Provides: python-foo = 6-1.fc66' in lines
|
||||
assert 'Provides: python3-foo = 6-1.fc66' in lines
|
||||
assert len(lines) == 3
|
||||
|
||||
|
||||
def test_py_provides_python3X_epoched():
|
||||
lines = rpm_eval(f'%py_provides python{X_Y}-foo', epoch='1', version='6', release='1.fc66')
|
||||
@pytest.mark.parametrize('rhel', [None, 27])
|
||||
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 'Provides: python-foo = 1:6-1.fc66' in lines
|
||||
assert 'Provides: python3-foo = 1:6-1.fc66' in lines
|
||||
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}',
|
||||
version='6', release='1.fc66')
|
||||
version='6', release='1.fc66', rhel=rhel)
|
||||
assert 'Provides: python3-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 len(lines) == 6
|
||||
assert len(set(lines)) == 3
|
||||
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(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',
|
||||
version='6', release='1.fc66')
|
||||
version='6', release='1.fc66', rhel=rhel)
|
||||
assert 'Provides: python3-foo = 123' in lines
|
||||
assert 'Provides: python-foo = 123' in lines
|
||||
assert f'Provides: python{X_Y}-foo = 123' in lines
|
||||
assert len(lines) == 3
|
||||
if rhel:
|
||||
assert f'Obsoletes: python{X_Y}-foo < 123' in lines
|
||||
assert len(lines) == 4
|
||||
else:
|
||||
assert len(lines) == 3
|
||||
|
||||
|
||||
def test_pytest_passes_options_naturally():
|
||||
|
Loading…
Reference in New Issue
Block a user