summaryrefslogtreecommitdiff
path: root/pbr/tests/test_commands.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-06-26 12:07:39 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-07-02 04:52:14 +0000
commit826380603382e4aa2d1eb57649da91dd3ba4e0a5 (patch)
tree6bf8f8a6a38b11e66571f87123ac377310186f5d /pbr/tests/test_commands.py
parent5039c9a3f81f5a5ee3fc92c37bebc1c7573a3c74 (diff)
downloadpbr-826380603382e4aa2d1eb57649da91dd3ba4e0a5.tar.gz
Expose a 'rpm_version' extra command
Intended usage, getting a rpm *compatible* version number from pbr from a pbr using python package. Typically this will then get put into a rpm spec file (what is used to build an rpm) and used to build an rpm using `rpmbuild` (the thing used to translate rpm spec files into rpms). For example: this allows [1][2] (which I am the primary maintainer of and godaddy, cray, and y! are users of) to get out of the whacky and/or flakey rpm version number calculation/conversion process (which previously just worked around by saying only use tags). [1] https://github.com/stackforge/anvil [2] https://anvil.readthedocs.org/en/latest/topics/summary.html Change-Id: I26cd1d6e8aef69d52e8a4f36bd264c690e712ba3
Diffstat (limited to 'pbr/tests/test_commands.py')
-rw-r--r--pbr/tests/test_commands.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pbr/tests/test_commands.py b/pbr/tests/test_commands.py
index c73a9f3..74f50df 100644
--- a/pbr/tests/test_commands.py
+++ b/pbr/tests/test_commands.py
@@ -56,3 +56,11 @@ class TestCommands(base.BaseTestCase):
self.addDetail('stderr', content.text_content(stderr))
self.assertIn('Running custom build_py command.', stdout)
self.assertEqual(return_code, 0)
+
+ def test_custom_rpm_version_py_command(self):
+ """Test custom rpm_version command."""
+ stdout, stderr, return_code = self.run_setup('rpm_version')
+ self.addDetail('stdout', content.text_content(stdout))
+ self.addDetail('stderr', content.text_content(stderr))
+ self.assertIn('Extracting rpm version', stdout)
+ self.assertEqual(return_code, 0)