File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import xcp .accessor
44
55class TestAccessor (unittest .TestCase ):
6- def test_http (self ):
7- #raise unittest.SkipTest("comment out if you really mean it")
8- a = xcp .accessor .createAccessor ("https://updates.xcp-ng.org/netinstall/8.2.1" , True )
6+ def check_repo_access (self , a ):
97 a .start ()
108 self .assertTrue (a .access ('.treeinfo' ))
119 self .assertFalse (a .access ('no_such_file' ))
1210 self .assertEqual (a .lastError , 404 )
1311 a .finish ()
1412
13+ def test_http_accessor_access (self ):
14+ # Temporary: To be obsoleted by a dedicated test case using a pytest-native
15+ # httpd which will cover code paths like HTTP Basic Auth in an upcoming commit:
16+ a = xcp .accessor .createAccessor ("https://updates.xcp-ng.org/netinstall/8.2.1" , True )
17+ self .check_repo_access (a )
18+
1519 def test_file (self ):
1620 a = xcp .accessor .createAccessor ("file://tests/data/repo/" , True )
17- a . start ( )
18- self . assertTrue ( a . access ( '.treeinfo' ))
19- self . assertFalse ( a . access ( 'no_such_file' ))
20- self . assertEqual ( a . lastError , 404 )
21- a . finish ( )
21+ self . check_repo_access ( a )
22+
23+ def test_filesystem_accessor_access ( self ):
24+ a = xcp . accessor . FilesystemAccessor ( "tests/data/repo/" , True )
25+ self . check_repo_access ( a )
You can’t perform that action at this time.
0 commit comments