From: Michael Tremer Date: Wed, 12 Oct 2022 17:31:22 +0000 (+0000) Subject: tests: Add some tests for builds X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01de82e0eaaf18b7d690aeb7a26d2e5d3c4fdfc3;p=pbs.git tests: Add some tests for builds Signed-off-by: Michael Tremer --- 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()