with self.assertRaises(RuntimeError):
build = self.backend.builds.create(self.repo, package, owner=self.user)
+ async def test_watchers(self):
+ """
+ Tests whether we can add a watcher to a build
+ """
+ path = self.source_path("tests/data/beep-1.3-2.ip3.src.pfm")
+
+ # Create the build
+ with self.db.transaction():
+ build = await self._create_build(path)
+
+ # Add the default user as watcher
+ with self.db.transaction():
+ build.add_watcher(self.user)
+
+ # Check if the watcher has been added
+ self.assertIn(self.user, build.get_watchers())
+
if __name__ == "__main__":
unittest.main()