-
Notifications
You must be signed in to change notification settings - Fork 3
Temporarily user C locale for date in spec changelog #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
make_parser, | ||
) | ||
from rift.Package import Package | ||
from rift.RPM import RPM | ||
from rift.RPM import RPM, Spec | ||
from rift.run import RunResult | ||
from rift import RiftError | ||
|
||
|
@@ -983,6 +983,63 @@ def test_action_sync_missing_output_parent(self): | |
main(['sync']) | ||
|
||
|
||
class ControllerProjectActionChangelogTest(RiftProjectTestCase): | ||
""" | ||
Tests class for Controller action changelog | ||
""" | ||
|
||
def test_action_changelog_without_pkg(self): | ||
"""changelog without package fails """ | ||
with self.assertRaisesRegex(SystemExit, "2"): | ||
main(['changelog']) | ||
|
||
def test_action_changelog_without_comment(self): | ||
"""changelog without comment fails """ | ||
with self.assertRaisesRegex(SystemExit, "2"): | ||
main(['changelog', 'pkg']) | ||
|
||
def test_action_changelog_without_maintainer(self): | ||
"""changelog without maintainer """ | ||
with self.assertRaisesRegex(RiftError, "You must specify a maintainer"): | ||
main(['changelog', 'pkg', '-c', 'basic change']) | ||
|
||
def test_action_changelog_pkg_not_found(self): | ||
"""changelog package not found""" | ||
with self.assertRaisesRegex( | ||
RiftError, | ||
"Package 'pkg' directory does not exist"): | ||
main(['changelog', 'pkg', '-c', 'basic change', '-t', 'Myself']) | ||
|
||
def test_action_changelog(self): | ||
"""simple changelog""" | ||
self.make_pkg() | ||
self.assertEqual( | ||
main(['changelog', 'pkg', '-c', 'basic change', '-t', 'Myself']), 0) | ||
spec = Spec(filepath=self.pkgspecs['pkg']) | ||
spec.load() | ||
self.assertEqual(spec.changelog_name, 'Myself <[email protected]> - 1.0-1') | ||
self.assertEqual(spec.version, '1.0') | ||
self.assertEqual(spec.release, '1') | ||
|
||
def test_action_changelog_bump(self): | ||
"""simple changelog with bump""" | ||
self.make_pkg() | ||
self.assertEqual( | ||
main(['changelog', 'pkg', '-c', 'basic change', '-t', 'Myself', '--bump']), | ||
0) | ||
spec = Spec(filepath=self.pkgspecs['pkg']) | ||
spec.load() | ||
self.assertEqual(spec.changelog_name, 'Myself <[email protected]> - 1.0-2') | ||
self.assertEqual(spec.version, '1.0') | ||
self.assertEqual(spec.release, '2') | ||
|
||
def test_action_changelog_unknown_maintainer(self): | ||
"""changelog with unknown maintainer""" | ||
self.make_pkg() | ||
with self.assertRaises(TypeError): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: shouldn't it be a RiftError and have a proper message aswell ? Seems like a common issue, so having its own error message would be nice There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, for sure. However, it's arguably out of scope of this PR. Do you want me to open another PR for this or just add a commit in this one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another PR is fine by me |
||
main(['changelog', 'pkg', '-c', 'basic change', '-t', 'Fail']) | ||
|
||
|
||
class ControllerArgumentsTest(RiftTestCase): | ||
""" Arguments parsing tests for Controller module""" | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.