From ecf95229d349281cc085bccf8e04cdd1862d5aa5 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 13 Nov 2016 22:40:06 +0000 Subject: [PATCH] Use asserts to guard single binary removal items Coverage suggests that the conditions are always true. If so, we can replace the "elif" with a regular "if" - but for now, lets keep an assert. Signed-off-by: Niels Thykier --- britney.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index 0a11f6f..fda9de9 100755 --- a/britney.py +++ b/britney.py @@ -2101,7 +2101,8 @@ class Britney(object): # single binary removal; used for clearing up after smooth # updates but not supported as a manual hint - elif source_name in binaries_t[migration_architecture][0]: + else: + assert source_name in binaries_t[migration_architecture][0] version = binaries_t[migration_architecture][0][source_name].version rms.add((source_name, version, migration_architecture)) @@ -2229,7 +2230,8 @@ class Britney(object): # single binary removal; used for clearing up after smooth # updates but not supported as a manual hint - elif item.package in packages_t[item.architecture][0]: + else: + assert item.package in packages_t[item.architecture][0] binaries_t_a = packages_t[item.architecture][0] pkg_id = binaries_t_a[item.package].pkg_id undo['binaries'][(item.package, item.architecture)] = pkg_id