Commit 21b1babd authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: Test clear=old from build number

parent 67e56470
......@@ -267,3 +267,42 @@ def test_clear_all_multiple_patterns():
elif channel == 'public': exppkgs = intpkgs + exppubpkgs
elif channel == 'internal': exppkgs = pubpkgs + expintpkgs
check_pkgs(exppkgs)
def test_clear_old_buildstr():
pkgs = ['linux-64/a-1.0-0',
'linux-64/a-1.0-1',
'linux-64/a-1.0-2',
'linux-64/b-1.0-habc_0',
'linux-64/b-1.0-habc_1',
'linux-64/b-1.0-habc_2',
'osx-64/a-1.0-0',
'osx-64/a-1.0-1',
'osx-64/a-1.0-2',
'osx-64/b-1.0-habc_0',
'osx-64/b-1.0-habc_1',
'osx-64/b-1.0-habc_2',
'noarch/c-1.0-0',
'noarch/c-1.0-1',
'noarch/c-1.0-2',
'noarch/d-1.0-habc_0',
'noarch/d-1.0-habc_1',
'noarch/d-1.0-habc_2']
exppkgs = [p for p in pkgs if p.endswith('2')]
pubpkgs = [op.join('public', f'{p}.tar.bz2') for p in pkgs]
intpkgs = [op.join('internal', f'{p}.tar.bz2') for p in pkgs]
exppubpkgs = [op.join('public', f'{p}.tar.bz2') for p in exppkgs]
expintpkgs = [op.join('internal', f'{p}.tar.bz2') for p in exppkgs]
for dry_run, channel in it.product([True, False], ['public', 'internal']):
with genenv('old', dry_run, channel):
create_mock_conda_channel('public', pkgs)
create_mock_conda_channel('internal', pkgs)
clear_channel.main()
if dry_run: exppkgs = intpkgs + pubpkgs
elif channel == 'public': exppkgs = intpkgs + exppubpkgs
elif channel == 'internal': exppkgs = pubpkgs + expintpkgs
check_pkgs(exppkgs)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment