@with_data("bison-1.27.tar.gz")
def test_is_not_git_repository_neg1(self, tarball):
"""Test raising exception when importing tarball outside of git."""
- GBS(argv=["gbs", "import", tarball])
+ try:
+ GBS(argv=["gbs", "import", tarball])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)
@raises(GbsError)
@with_data("bad.src.rpm")
def test_error_reading_pkg_header_neg1(self, srcrpm):
"""Test raising exception when importing from bad package."""
- GBS(argv=["gbs", "import", srcrpm])
+ try:
+ GBS(argv=["gbs", "import", srcrpm])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)
@raises(GbsError)
@with_data("bad.spec")
def test_cant_parse_specfile_neg1(self, spec):
"""Test raising exception when importing from non-parseable spec."""
- GBS(argv=["gbs", "import", spec])
+ try:
+ GBS(argv=["gbs", "import", spec])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)
@raises(SystemExit)
def test_missing_argument_neg1(self):
"""Test raising exception when running gbs without any arguments."""
- GBS(argv=["gbs", "import"])
+ try:
+ GBS(argv=["gbs", "import"])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)
@raises(SystemExit)
def test_too_many_arguments_neg1(self):
"""Test raising exception when running gbs with too many arguments."""
- GBS(argv=["gbs", "import", "1", "2"])
+ try:
+ GBS(argv=["gbs", "import", "1", "2"])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)
@raises(GbsError)
def test_path_doesnt_exist_neg1(self):
"""Test raising exception when running gbs with not existing path."""
- GBS(argv=["gbs", "import", "I don't exist!"])
+ try:
+ GBS(argv=["gbs", "import", "I don't exist!"])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)
@raises(GbsError)
def test_log_clone_pos1(self):
"""Test the waiting funciton wiht gbs clone command"""
- GBS(argv=["gbs", "clone", "I don't exist!"])
+ try:
+ GBS(argv=["gbs", "clone", "I don't exist!"])
+ except SystemExit as err:
+ self.assertEqual(err.code, 0)