diff options
author | Tim Harder <radhermit@gmail.com> | 2021-06-30 16:34:16 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2021-06-30 16:36:57 -0600 |
commit | ebf30c16f1f0369a972d34dc581c6e6a2643f510 (patch) | |
tree | d13587ce54f7470762ddd0d222188a43491f6b51 /tests/scripts | |
parent | tests: add initial generated summary checks for metadata changes (diff) | |
download | pkgdev-ebf30c16f1f0369a972d34dc581c6e6a2643f510.tar.gz pkgdev-ebf30c16f1f0369a972d34dc581c6e6a2643f510.tar.bz2 pkgdev-ebf30c16f1f0369a972d34dc581c6e6a2643f510.zip |
tests: add more metadata summary checks
Diffstat (limited to 'tests/scripts')
-rw-r--r-- | tests/scripts/test_pkgdev_commit.py | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/scripts/test_pkgdev_commit.py b/tests/scripts/test_pkgdev_commit.py index 9412dc7..9ddb801 100644 --- a/tests/scripts/test_pkgdev_commit.py +++ b/tests/scripts/test_pkgdev_commit.py @@ -603,6 +603,87 @@ class TestPkgdevCommit: """)) assert commit() == 'cat/pkg: update maintainers' + # add allarches tag + with open(pjoin(pkgdir, 'metadata.xml'), 'w') as f: + f.write(textwrap.dedent("""\ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> + <pkgmetadata> + <maintainer type="person"> + <email>person@email.com</email> + <name>Person</name> + </maintainer> + <stabilize-allarches/> + </pkgmetadata> + """)) + assert commit() == 'cat/pkg: mark ALLARCHES' + + # drop allarches tag + with open(pjoin(pkgdir, 'metadata.xml'), 'w') as f: + f.write(textwrap.dedent("""\ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> + <pkgmetadata> + <maintainer type="person"> + <email>person@email.com</email> + <name>Person</name> + </maintainer> + </pkgmetadata> + """)) + assert commit() == 'cat/pkg: drop ALLARCHES' + + # add upstream metadata + with open(pjoin(pkgdir, 'metadata.xml'), 'w') as f: + f.write(textwrap.dedent("""\ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> + <pkgmetadata> + <maintainer type="person"> + <email>person@email.com</email> + <name>Person</name> + </maintainer> + <upstream> + <remote-id type="github">pkgcore/pkgdev</remote-id> + <remote-id type="pypi">pkgdev</remote-id> + </upstream> + </pkgmetadata> + """)) + assert commit() == 'cat/pkg: add github, pypi upstream metadata' + + # remove upstream metadata + with open(pjoin(pkgdir, 'metadata.xml'), 'w') as f: + f.write(textwrap.dedent("""\ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> + <pkgmetadata> + <maintainer type="person"> + <email>person@email.com</email> + <name>Person</name> + </maintainer> + <upstream> + <remote-id type="github">pkgcore/pkgdev</remote-id> + </upstream> + </pkgmetadata> + """)) + assert commit() == 'cat/pkg: remove pypi upstream metadata' + + # update upstream metadata + with open(pjoin(pkgdir, 'metadata.xml'), 'w') as f: + f.write(textwrap.dedent("""\ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> + <pkgmetadata> + <maintainer type="person"> + <email>person@email.com</email> + <name>Person</name> + </maintainer> + <upstream> + <remote-id type="github">pkgcore/pkgcheck</remote-id> + </upstream> + </pkgmetadata> + """)) + assert commit() == 'cat/pkg: update upstream metadata' + def test_no_summary(self, capsys, repo, make_git_repo): git_repo = make_git_repo(repo.location) repo.create_ebuild('cat/pkg-0') |