149
149
distroseries.main_archive, distroseries, pocket, bpns)
150
150
self.assertThat(recorder, HasQueryCount(Equals(4)))
152
def test_getComponentOverride_default_name(self):
153
# getComponentOverride returns the default component name when an
154
# unknown component name is passed.
155
component_name = UnknownOverridePolicy.getComponentOverride('no-name')
157
self.assertEqual('universe', component_name)
159
def test_getComponentOverride_default_component(self):
160
# getComponentOverride also accepts a component object (as
161
# opposed to a component's name).
162
component = getUtility(IComponentSet)['universe']
163
component_name = UnknownOverridePolicy.getComponentOverride(component)
165
self.assertEqual('universe', component_name)
167
def test_getComponentOverride_return_component(self):
168
# Passing return_component=True to getComponentOverride makes it
169
# return the Component object (as opposed to the component's
171
universe_component = getUtility(IComponentSet)['universe']
172
component = UnknownOverridePolicy.getComponentOverride(
173
universe_component, return_component=True)
175
self.assertEqual(universe_component, component)
152
177
def test_unknown_sources(self):
153
178
# If the unknown policy is used, it does no checks, just returns the