Skip to content

Commit

Permalink
Merge pull request #94 from k-dominik/fix-main-no-return
Browse files Browse the repository at this point in the history
propagate return code in `util.main_from_endpoint`
  • Loading branch information
ctrueden authored Jun 1, 2023
2 parents 2d98c80 + f311f17 commit 89d20d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jgo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ def main_from_endpoint(
+ paintera_argv
)

main(argv=argv)
return main(argv=argv)
8 changes: 8 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,13 @@ def test_main_from_endpoint_with_jvm_args(self, run_mock):
self.assertIn("org.slf4j:slf4j-simple", coordinates)


class TestUtilMainCaughtExceptions(unittest.TestCase):
def test_without_endpoint(self):
rv = main_from_endpoint(
"", argv=[], primary_endpoint_version="", secondary_endpoints=()
)
self.assertEqual(rv, 254, "Expected return code 254.")


if __name__ == "__main__":
unittest.main()

0 comments on commit 89d20d1

Please sign in to comment.