# Local path
path = self.local_path()
+ # Ensure the parent directory exists
+ os.makedirs(os.path.dirname(path), exist_ok=True)
+
# Move the old data to the temporary space
try:
shutil.move(path, bin)
path = self.source_path("tests/data/beep-1.3-2.ip3.x86_64.pfm")
# Upload a package
- package = await self._create_upload(path)
+ #package = await self._create_upload(path)
# Upload the log
- log = await self._create_upload(
+ logfile = await self._create_upload(
self.source_path("tests/data/beep-1.3-2.ip3.x86_64.log"),
)
await job.finished(
success=True,
#packages=[package],
- log=log,
+ logfile=logfile,
)
async def test_fail(self):
job = build.jobs[0]
# Upload the log
- log = await self._create_upload(
+ logfile = await self._create_upload(
self.source_path("tests/data/beep-1.3-2.ip3.x86_64.log"),
)
# Pretend that the job has failed
await job.finished(
success=False,
- log=log,
+ logfile=logfile,
)
async def test_abort(self):
await job.open_log()
# Upload the log
- log = await self._create_upload(
+ logfile = await self._create_upload(
self.source_path("tests/data/beep-1.3-2.ip3.x86_64.log"),
)
# Pretend that the job has failed
await job.finished(
success=False,
- log=log,
+ logfile=logfile,
)
# Check if we have a log
Tests whether we can create a distribution
"""
with self.db.transaction():
- distro = self.backend.distros.create("Random Test Distribution 1", "test1")
+ distro = self.backend.distros.create("Random Test Distribution 2", "test", 2)
# Check that we got the correct type back
self.assertIsInstance(distro, distribution.Distribution)
# Check if the values got set correct
- self.assertEqual(distro.name, "Random Test Distribution 1")
- self.assertEqual(distro.tag, "test1")
+ self.assertEqual(distro.name, "Random Test Distribution 2")
+ self.assertEqual(distro.slug, "test-2")
+ self.assertEqual(distro.tag, "test2")
def test_default(self):
"""
self.user.quota = 104857600 # 100 MiB
# Create a distribution
- self.distro = self.backend.distros.create("Default Test Distribution", "test1")
+ self.distro = self.backend.distros.create("Default Test Distribution", "test", 1)
# Enable this distribution for aarch64 & x86_64
self.distro.arches = ["aarch64", "x86_64"]