Main classes¶
- class scope_harness.ScopeHarness¶
This is the main class for scope harness testing. An instance of it needs to be created using one of the static class methods (new_from_*) before any tests can be performed. The instance of ResultsView provided by results_view property is the entry point for invoking actual queries.
- Here is an example of a search request:
- harness = ScopeHarness.new_from_scope_list(Parameters([‘my-scope.ini’]) view = harness.results_view view.active_scope = ‘my-scope’ view.search_query = ‘’
- static new_from_pre_existing_config((str)arg1) → ScopeHarness :¶
Creates ScopeHarness instance from scope runtime configuration files in given directory
- static new_from_scope_list((Parameters)arg1) → ScopeHarness :¶
Creates ScopeHarness instance from a configuration provided by an instance of CustomRegistry passed to this factory method
- static new_from_system() → ScopeHarness :¶
Creates ScopeHarness instance using default configuration from the system
- class scope_harness.CustomRegistry((object)arg1, (Parameters)arg2)¶
- start((CustomRegistry)arg1) → None¶
- class scope_harness.Parameters((object)arg1, (object)arg2)¶
Parameters for instantiating a CustomRegistry instace
- enable_scopes((Parameters)arg1[, (bool)system_scopes=False[, (bool)click_scopes=False[, (bool)oem_scopes=False[, (bool)remote_scopes=False]]]]) → None :¶
Enable particular types of scopes via named arguments
- include_click_scopes((Parameters)arg1) → Parameters :¶
Enable click scopes
- include_oem_scopes((Parameters)arg1) → Parameters :¶
Enable OEM scopes
- include_remote_scopes((Parameters)arg1) → Parameters :¶
Enable remote scopes from Ubuntu servers
- include_system_scopes((Parameters)arg1) → Parameters :¶
Enable system scopes
- class scope_harness.MatchResult((object)arg1)¶
Represents the result of matching and is the final object you want to check in your tests. An instance of MatchResult can be obtained by calling one of the match() methods of ResultMatcher, CategoryMatcher, CategoryListMatcher, DepartmentMatcher and ChildDepartmentMatcher. When implementing tests on top of scope_harness.testing.ScopeHarnessTestCase class, use its assertMatchResult helper method to assert on MatchResult instance.
- concat_failures¶
- failure((MatchResult)arg1, (str)arg2) → None¶
- failures¶
- success¶