tests/python/archive.py \
tests/python/ctx.py \
tests/python/keys.py \
+ tests/python/main.py \
tests/python/package.py \
tests/python/version_compare.py
# The rest will be tested in packages.py
+ def test_open_stub(self):
+ # Launch Pakfire in stub mode
+ p = self.setup_pakfire(stub=True)
+
+ # Make path
+ path = self.path("beep-1.3-2.ip3.x86_64.pfm")
+
+ # Open the archive
+ archive = self.pakfire.open(path)
+
+ # Fetch the filelist
+ self.assertIsInstance(archive.filelist, list)
if __name__ == "__main__":
tests.main()
# Return a new context
return pakfire.Ctx(path=path, **kwargs)
- def setup_pakfire(self, ctx=None, path=None, config=None, **kwargs):
+ def setup_pakfire(self, ctx=None, path=None, config=None, stub=False, **kwargs):
"""
Sets up a new Pakfire environment
"""
if path is None:
path = os.environ.get("TEST_STUB_ROOT")
+ # If we are in stub mode, we need to reset the path
+ if stub:
+ path = None
+
with open(config, "r") as f:
config = f.read()
- return pakfire.Pakfire(ctx=ctx, path=path, config=config, **kwargs)
+ return pakfire.Pakfire(ctx=ctx, path=path, config=config, stub=stub, **kwargs)
def path(self, *args, **kwargs):
"""