33
44import pytest
55from pkgcore .const import EBD_PATH
6- from pkgcore .ebuild import eapi
6+ from pkgcore .ebuild import eapi as eapi_mod
77from pkgcore .ebuild .eapi import EAPI , get_eapi
88
99
@@ -43,36 +43,36 @@ def test_get_eapi():
4343 assert unknown_eapi == get_eapi ("unknown" )
4444
4545 # known EAPI
46- assert get_eapi ("6" ) == eapi .eapi6
46+ assert get_eapi ("6" ) == eapi_mod .eapi6
4747
4848
4949def test_get_PMS_eapi ():
5050 # test PMS filtration
51- assert get_eapi ("6" ) is eapi .eapi6
51+ assert get_eapi ("6" ) is eapi_mod .eapi6
5252 # hold the reference, known_eapis is weakval
5353 temp = EAPI .register ("1234" )
5454 # confirm it's visable
5555 assert get_eapi ("1234" , suppress_unsupported = False ) is temp
56- assert eapi .get_PMS_eapi ("1234" ) is None
56+ assert eapi_mod .get_PMS_eapi ("1234" ) is None
5757 temp2 = EAPI .register ("9999" , pms = True )
58- assert eapi .get_PMS_eapi ("9999" ) is temp2
58+ assert eapi_mod .get_PMS_eapi ("9999" ) is temp2
5959
6060
6161def test_get_PMS_eapis ():
62- pms_eapis = set (eapi .get_PMS_eapis ())
62+ pms_eapis = set (eapi_mod .get_PMS_eapis ())
6363 expected = set (x for x in EAPI .known_eapis .values () if x .pms )
6464 assert pms_eapis == expected
6565
6666
6767def test_get_latest_pms_eapi ():
6868 # if it's not in there, the magic constant isn't in alignment
69- assert eapi .get_latest_PMS_eapi () in list (eapi .get_PMS_eapis ())
69+ assert eapi_mod .get_latest_PMS_eapi () in list (eapi_mod .get_PMS_eapis ())
7070
7171 # Note, this can false positive while a new EAPI is being developed. If this
7272 # is an actual issue, then introduce a flag on EAPI objects that indicates 'latest pms',
7373 # and update get_latest_PMS_eapi to scan for that, and register() to block duplicate.
7474 assert (
75- eapi .get_latest_PMS_eapi ()
75+ eapi_mod .get_latest_PMS_eapi ()
7676 is sorted (
7777 (x for x in EAPI .known_eapis .values () if x .pms ),
7878 key = lambda e : int (e ._magic ),
@@ -94,7 +94,7 @@ def test_register(self, tmp_path):
9494 mock_ebd_temp = str (shutil .copytree (EBD_PATH , tmp_path / "ebd" ))
9595 with (
9696 mock .patch ("pkgcore.ebuild.eapi.bash_version" ) as bash_version ,
97- mock .patch .dict (eapi .EAPI .known_eapis ),
97+ mock .patch .dict (eapi_mod .EAPI .known_eapis ),
9898 mock .patch ("pkgcore.ebuild.eapi.const.EBD_PATH" , mock_ebd_temp ),
9999 ):
100100 # inadequate bash version
@@ -115,11 +115,11 @@ def test_register(self, tmp_path):
115115 assert test_eapi ._magic == "test1"
116116
117117 def test_is_supported (self , tmp_path , caplog ):
118- assert eapi .eapi6 .is_supported
118+ assert eapi_mod .eapi6 .is_supported
119119
120120 mock_ebd_temp = str (shutil .copytree (EBD_PATH , tmp_path / "ebd" ))
121121 with (
122- mock .patch .dict (eapi .EAPI .known_eapis ),
122+ mock .patch .dict (eapi_mod .EAPI .known_eapis ),
123123 mock .patch ("pkgcore.ebuild.eapi.const.EBD_PATH" , mock_ebd_temp ),
124124 ):
125125 # partially supported EAPI is flagged as such
0 commit comments