diff options
author | Thomas Bracht Laumann Jespersen <t@laumann.xyz> | 2022-03-29 15:38:35 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gmail.com> | 2022-04-07 22:28:44 +0300 |
commit | 135ddb364f445cb3c017305eb90c89db31dbfdb0 (patch) | |
tree | 04ccd0b20f5dbe25a9ca0f3b07d9f0ab8be3012d /tests | |
parent | pkgdev mask: Accept -b/--bug for referencing bugs (diff) | |
download | pkgdev-135ddb364f445cb3c017305eb90c89db31dbfdb0.tar.gz pkgdev-135ddb364f445cb3c017305eb90c89db31dbfdb0.tar.bz2 pkgdev-135ddb364f445cb3c017305eb90c89db31dbfdb0.zip |
pkgdev mask: Test both -r and --rites
Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scripts/test_pkgdev_mask.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/scripts/test_pkgdev_mask.py b/tests/scripts/test_pkgdev_mask.py index a5eddf7..557265b 100644 --- a/tests/scripts/test_pkgdev_mask.py +++ b/tests/scripts/test_pkgdev_mask.py @@ -182,18 +182,20 @@ class TestPkgdevMask: assert self.profile.masks == frozenset([atom_cls('cat/masked'), atom_cls('=cat/pkg-0')]) def test_last_rites(self): - with os_environ(EDITOR="sed -i '1s/$/mask comment/'"), \ - patch('sys.argv', self.args + ['cat/pkg', '-r']), \ - pytest.raises(SystemExit), \ - chdir(pjoin(self.repo.path)): - self.script() - removal_date = self.today + timedelta(days=30) today = self.today.strftime('%Y-%m-%d') removal = removal_date.strftime('%Y-%m-%d') - assert self.masks_path.read_text() == textwrap.dedent(f"""\ - # First Last <first.last@email.com> ({today}) - # mask comment - # Removal: {removal} - cat/pkg - """) + for rflag in ('-r', '--rites'): + with os_environ(EDITOR="sed -i '1s/$/mask comment/'"), \ + patch('sys.argv', self.args + ['cat/pkg', rflag]), \ + pytest.raises(SystemExit), \ + chdir(pjoin(self.repo.path)): + self.script() + + assert self.masks_path.read_text() == textwrap.dedent(f"""\ + # First Last <first.last@email.com> ({today}) + # mask comment + # Removal: {removal} + cat/pkg + """) + self.masks_path.write_text("") # Reset the contents of package.mask |