def test_install_units(self): errata_obj = self.get_test_errata_object() errata_unit = Unit(TYPE_ID_ERRATA, {"id":errata_obj["id"]}, errata_obj, None) existing_units = [errata_unit] test_repo = profiler_mocks.get_repo("test_repo_id") conduit = profiler_mocks.get_profiler_conduit(existing_units=existing_units, repo_bindings=[test_repo]) example_errata = {"unit_key":errata_unit.unit_key, "type_id":TYPE_ID_ERRATA} prof = RPMErrataProfiler() translated_units = prof.install_units(self.test_consumer, [example_errata], None, None, conduit) self.assertEqual(len(translated_units), 2) expected = [] for r in self.test_consumer.profiles[TYPE_ID_RPM]: expected_name = "%s.%s" % (r["name"], r["arch"]) expected.append(expected_name) for u in translated_units: rpm_name = u["unit_key"]["name"] self.assertTrue(rpm_name in expected)