@@ -4568,6 +4568,37 @@ def test_github_new_pr_dependencies(self):
45684568
45694569 self ._assert_regexs (regexs , txt )
45704570
4571+ def test_new_pr_easyblock (self ):
4572+ """
4573+ Test using --new-pr to open an easyblocks PR
4574+ """
4575+
4576+ if self .github_token is None :
4577+ print ("Skipping test_new_pr_easyblock, no GitHub token available?" )
4578+ return
4579+
4580+ topdir = os .path .dirname (os .path .abspath (__file__ ))
4581+ toy_eb = os .path .join (topdir , 'sandbox' , 'easybuild' , 'easyblocks' , 't' , 'toy.py' )
4582+ self .assertTrue (os .path .exists (toy_eb ))
4583+
4584+ args = [
4585+ '--github-user=%s' % GITHUB_TEST_ACCOUNT ,
4586+ '--new-pr' ,
4587+ toy_eb ,
4588+ '-D' ,
4589+ ]
4590+ txt , _ = self ._run_mock_eb (args , do_build = True , raise_error = True , testing = False )
4591+
4592+ patterns = [
4593+ r'target: easybuilders/easybuild-easyblocks:develop' ,
4594+ r'from: easybuild_test/easybuild-easyblocks:[0-9]+_new_pr_toy' ,
4595+ r'title: "new easyblock for toy"' ,
4596+ r'easybuild/easyblocks/t/toy.py' ,
4597+ ]
4598+ for pattern in patterns :
4599+ regex = re .compile (pattern )
4600+ self .assertTrue (regex .search (txt ), "Pattern '%s' should be found in: %s" % (regex .pattern , txt ))
4601+
45714602 def test_github_merge_pr (self ):
45724603 """
45734604 Test use of --merge-pr (dry run)"""
0 commit comments