From 01de82e0eaaf18b7d690aeb7a26d2e5d3c4fdfc3 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 12 Oct 2022 17:31:22 +0000 Subject: [PATCH] tests: Add some tests for builds Signed-off-by: Michael Tremer --- Makefile.am | 1 + tests/build.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 tests/build.py diff --git a/Makefile.am b/Makefile.am index 58b22183..94db0b10 100644 --- a/Makefile.am +++ b/Makefile.am @@ -486,6 +486,7 @@ TESTS_ENVIRONMENT = \ dist_check_SCRIPTS = \ tests/setup.py \ + tests/build.py \ tests/builder.py \ tests/distro.py \ tests/package.py \ diff --git a/tests/build.py b/tests/build.py new file mode 100755 index 00000000..96610894 --- /dev/null +++ b/tests/build.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 + +import unittest + +import test + +class BuildTestCase(test.TestCase): + """ + Tests everything around builds + """ + async def test_create_from_binary(self): + """ + Tests whether we can create a build from a binary package + """ + path = self.source_path("tests/data/beep-1.3-2.ip3.x86_64.pfm") + + with self.db.transaction(): + package = await self._create_package(path) + + # Create the build + with self.assertRaises(RuntimeError): + build = self.backend.builds.create(self.repo, package, owner=self.user) + + +if __name__ == "__main__": + unittest.main() -- 2.47.3