File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import ast
16- import errno
1716import io
1817import json
1918import os
@@ -732,8 +731,8 @@ def test_rootdirescape(self) -> None:
732731 self .distro = distro .LinuxDistribution (
733732 root_dir = os .path .join (TESTDISTROS , "distro" , "rootdirescape" )
734733 )
735- with pytest . raises ( FileNotFoundError , match = r"resolves outside" ):
736- self .distro . id ( )
734+ # loading existing file outside of root_dir has been prevented (empty data)
735+ self ._test_outcome ({} )
737736
738737 def test_rootdirnonescape (self ) -> None :
739738 self .distro = distro .LinuxDistribution (
@@ -746,9 +745,8 @@ def test_symlinksloop(self) -> None:
746745 self .distro = distro .LinuxDistribution (
747746 root_dir = os .path .join (TESTDISTROS , "distro" , "symlinksloop" )
748747 )
749- with pytest .raises (OSError ) as excinfo :
750- self .distro .id ()
751- assert excinfo .value .errno == errno .ELOOP
748+ # due to symbolic links loop, loading of file has been prevented (empty data)
749+ self ._test_outcome ({})
752750
753751 def test_dontincludeuname (self ) -> None :
754752 self ._setup_for_distro (os .path .join (TESTDISTROS , "distro" , "dontincludeuname" ))
You can’t perform that action at this time.
0 commit comments