usd-importer/gitubuntu/source_information.py:107:
copy_paste_error: "u_ddi" in "_ddi.codename" looks like a copy-paste error.
usd-importer/gitubuntu/source_information.py:107:
remediation: Should it say "u_udi" instead?
The code is erroneously using the Debian implementation of codename(),
which translates aliases ('unstable', 'testing', etc.) to the release
codenames ('sid', 'buster', etc.) Fortunately, if it doesn't match
anything it just returns the release name passed to it, which is exactly
what the Ubuntu implementation of codename() does.
Thus, even though the code is incorrect, it's behavior will always be
correct in practice. Thus this fix corrects a purely theoretical
problem, not one that would produce invalid behavior.
source_information: Add tests for derive_codename_from_series()
Provide a set of test cases for source_information's
derive_codename_from_series() routine.
The first two test cases check ordinary usage, simple codename->codename
and alias->codename lookups (i.e. 'bionic'->'bionic', and
'unstable'->'sid' respectively). The third test checks that invalid
input triggers an exception as expected. These three tests depend on
the external distro-info and distro-info-data packages.
The last test provides a mock of the DebianDistroInfo class that
includes stricter input checking for its codename() routine. This test
case identifies a code error in derive_codename_from_series() that was
found via Coverity.