b.t.t.TestGraph(TestCaseWithMemoryTransport) : class documentation

Part of bzrlib.tests.test_graph View In Hierarchy

No class docstring
Method make_graph Undocumented
Method prepare_memory_tree Undocumented
Method build_ancestry Create an ancestry as specified by a graph dict
Method test_lca Test finding least common ancestor.
Method test_no_unique_lca Test error when one revision is not in the graph
Method test_lca_criss_cross Test least-common-ancestor after a criss-cross merge.
Method test_lca_shortcut Test least-common ancestor on this history shortcut
Method test_lefthand_distance_smoke A simple does it work test for graph.lefthand_distance(keys).
Method test_lefthand_distance_ghosts A simple does it work test for graph.lefthand_distance(keys).
Method test_recursive_unique_lca Test finding a unique least common ancestor.
Method assertRemoveDescendants Undocumented
Method test__remove_simple_descendants Undocumented
Method test__remove_simple_descendants_disjoint Undocumented
Method test__remove_simple_descendants_chain Undocumented
Method test__remove_simple_descendants_siblings Undocumented
Method test_unique_lca_criss_cross Ensure we don't pick non-unique lcas in a criss-cross
Method test_unique_lca_null_revision Ensure we pick NULL_REVISION when necessary
Method test_unique_lca_null_revision2 Ensure we pick NULL_REVISION when necessary
Method test_lca_double_shortcut Undocumented
Method test_common_ancestor_two_repos Ensure we do unique_lca using data from two repos
Method test_graph_difference Undocumented
Method test_graph_difference_separate_ancestry Undocumented
Method test_graph_difference_criss_cross Undocumented
Method test_graph_difference_extended_history Undocumented
Method test_graph_difference_double_shortcut Undocumented
Method test_graph_difference_complex_shortcut Undocumented
Method test_graph_difference_complex_shortcut2 Undocumented
Method test_graph_difference_shortcut_extra_root Undocumented
Method test_iter_topo_order Undocumented
Method test_is_ancestor Undocumented
Method test_is_between Undocumented
Method test_is_ancestor_boundary Ensure that we avoid searching the whole graph.
Method test_iter_ancestry Undocumented
Method test_iter_ancestry_with_ghost Undocumented
Method test_filter_candidate_lca Test filter_candidate_lca for a corner case
Method test_heads_null Undocumented
Method test_heads_one Undocumented
Method test_heads_single Undocumented
Method test_heads_two_heads Undocumented
Method test_heads_criss_cross Undocumented
Method test_heads_shortcut Undocumented
Method test_heads_limits_search Undocumented
Method test_heads_limits_search_assymetric Undocumented
Method test_heads_limits_search_common_search_must_continue Undocumented
Method test_breadth_first_search_start_ghosts Undocumented
Method test_breadth_first_search_deep_ghosts Undocumented
Method test_breadth_first_search_change_next_to_next_with_ghosts Undocumented
Method test_breadth_first_change_search Undocumented
Method assertSeenAndResult Check the results of .seen and get_result() for a seach.
Method test_breadth_first_get_result_excludes_current_pending Undocumented
Method test_breadth_first_get_result_starts_stops Undocumented
Method test_breadth_first_stop_searching_not_queried Undocumented
Method test_breadth_first_stop_searching_late Undocumented
Method test_breadth_first_get_result_ghosts_are_excluded Undocumented
Method test_breadth_first_get_result_starting_a_ghost_ghost_is_excluded Undocumented
Method test_breadth_first_revision_count_includes_NULL_REVISION Undocumented
Method test_breadth_first_search_get_result_after_StopIteration Undocumented
Method _run_heads_break_deeper Run heads on a graph-as-a-dict.

Inherited from TestCaseWithMemoryTransport:

Method __init__ Undocumented
Method get_transport Return a writeable transport.
Method get_readonly_transport Return a readonly transport for the test scratch space
Method create_transport_readonly_server Create a transport server from class defined at init.
Method get_readonly_server Get the server instance for the readonly transport
Method get_readonly_url Get a URL for the readonly transport.
Method get_vfs_only_server Get the vfs only read/write server instance.
Method get_server Get the read/write server instance.
Method get_url Get a URL (or maybe a path) for the readwrite transport.
Method get_vfs_only_url Get a URL (or maybe a path for the plain old vfs transport.
Method makeAndChdirToTestDir Create a temporary directories for this one test.
Method make_branch Create a branch on the transport at relpath.
Method get_default_format Undocumented
Method resolve_format Resolve an object to a ControlDir format object.
Method make_bzrdir Undocumented
Method make_repository Create a repository on our default transport at relpath.
Method make_smart_server Undocumented
Method make_branch_and_memory_tree Create a branch on the default transport and a MemoryTree for it.
Method make_branch_builder Undocumented
Method overrideEnvironmentForTesting Undocumented
Method setUp Undocumented
Method setup_smart_server_with_call_log Sets up a smart server as the transport server with a call log.
Method reset_smart_call_log Undocumented
Method _adjust_url Get a URL (or maybe a path) for the readwrite transport.
Method _create_safety_net Make a fake bzr directory.
Method _check_safety_net Check that the safety .bzr directory have not been touched.
Method _make_test_root Undocumented

Inherited from TestCase (via TestCaseWithMemoryTransport):

Method debug Undocumented
Method discardDetail Extend the addDetail, getDetails api so we can remove a detail.
Method install_counter_hook Install a counting hook.
Method disable_directory_isolation Turn off directory isolation checks.
Method enable_directory_isolation Enable directory isolation checks.
Method permit_dir Permit a directory to be used by this test. See permit_url.
Method permit_url Declare that url is an ok url to use in this test.
Method permit_source_tree_branch_repo Permit the source tree bzr is running from to be opened.
Method record_directory_isolation Gather accessed directories to permit later access.
Method start_server Start transport_server for this test.
Method assertEqual Undocumented
Method assertEqualDiff Assert two texts are equal, if not raise an exception.
Method assertEqualMode Undocumented
Method assertEqualStat assert that expected and actual are the same stat result.
Method assertLength Assert that obj_with_len is of length length.
Method assertLogsError Assert that func(*args, **kwargs) quietly logs a specific error.
Method assertPositive Assert that val is greater than 0.
Method assertNegative Assert that val is less than 0.
Method assertStartsWith Undocumented
Method assertEndsWith Asserts that s ends with suffix.
Method assertContainsRe Assert that a contains something matching a regular expression.
Method assertNotContainsRe Assert that a does not match a regular expression
Method assertContainsString Undocumented
Method assertNotContainsString Undocumented
Method assertSubset Assert that every entry in sublist is present in superlist.
Method assertListRaises Fail unless excClass is raised when the iterator from func is used.
Method assertRaises Assert that a callable raises a particular exception.
Method assertIs Undocumented
Method assertIsNot Undocumented
Method assertTransportMode Fail if a path does not have mode "mode".
Method assertIsSameRealPath Fail if path1 and path2 points to different files
Method assertIsInstance Fail if obj is not an instance of kls
Method assertFileEqual Fail if path does not contain 'content'.
Method assertDocstring Fail if obj does not have expected_docstring
Method failUnlessExists Undocumented
Method assertPathExists Fail unless path or paths, which may be abs or relative, exist.
Method failIfExists Undocumented
Method assertPathDoesNotExist Fail if path or paths, which may be abs or relative, exist.
Method applyDeprecated Call a deprecated callable without warning the user.
Method callCatchWarnings Call a callable that raises python warnings.
Method callDeprecated Assert that a callable is deprecated in a particular way.
Method thisFailsStrictLockCheck It is known that this test would fail with -Dstrict_locks.
Method overrideAttr Overrides an object attribute restoring it after the test.
Method overrideEnv Set an environment variable, and reset it after the test.
Method recordCalls Monkeypatch in a wrapper that will record calls.
Method knownFailure Declare that this test fails for a known reason
Method time Run callable and accrue the time it takes to the benchmark time.
Method log Undocumented
Method get_log Get a unicode string containing the log from bzrlib.trace.
Method requireFeature This test requires a specific feature is available.
Method run_bzr Invoke bzr, as if it were run from the command line.
Method run_bzr_error Run bzr, and check that stderr contains the supplied regexes
Method run_bzr_subprocess Run bzr in a subprocess for testing.
Method start_bzr_subprocess Start bzr in a subprocess for testing.
Method get_source_path Return the path of the directory containing bzrlib.
Method get_bzr_path Return the path of the 'bzr' executable for this test suite.
Method finish_bzr_subprocess Finish the execution of process.
Method check_tree_shape Compare a tree to a list of expected names.
Method apply_redirected Call callable with redirected std io pipes.
Method reduceLockdirTimeout Reduce the default lock timeout for the duration of the test, so that
Method make_utf8_encoded_stringio Return a StringIOWrapper instance, that will encode Unicode
Method disable_verb Disable a smart server verb for one test.
Method _install_config_stats_hooks Install config hooks to count hook calls.
Method _clear_debug_flags Prevent externally set debug flags affecting tests.
Method _clear_hooks Undocumented
Method _silenceUI Turn off UI for duration of test
Method _check_locks Check that all lock take/release actions have been paired.
Method _track_locks Track lock activity during tests.
Method _lock_acquired Undocumented
Method _lock_released Undocumented
Method _lock_broken Undocumented
Method _preopen_isolate_transport Check that all transport openings are done in the test work area.
Method _preopen_isolate_url Undocumented
Method _track_transports Install checks for transport usage.
Method _ndiff_strings Return ndiff between two strings containing lines.
Method _capture_deprecation_warnings A helper for callDeprecated and applyDeprecated.
Method _startLogFile Setup a in-memory target for bzr and testcase log messages
Method _finishLogFile Flush and dereference the in-memory log for this testcase
Method _cleanEnvironment Undocumented
Method _restoreHooks Undocumented
Method _suppress_log Remove the log info from details.
Method _do_skip Undocumented
Static Method _do_known_failure Undocumented
Static Method _do_not_applicable Undocumented
Static Method _report_skip Override the default _report_skip.
Static Method _report_expected_failure Strip the log.
Static Method _do_unsupported_or_skip Undocumented
Method _run_bzr_autosplit Run bazaar command line, splitting up a string command line.
Method _run_bzr_core Undocumented
Method _add_subprocess_log Undocumented
Method _subprocess_log_cleanup Undocumented
Method _popen Place a call to Popen.
def make_graph(self, ancestors):
Undocumented
def prepare_memory_tree(self, location):
Undocumented
def build_ancestry(self, tree, ancestors):
Create an ancestry as specified by a graph dict
ParameterstreeA tree to use
ancestorsa dict of {node: [node_parent, ...]}
def test_lca(self):
Test finding least common ancestor.

ancestry_1 should always have a single common ancestor

def test_no_unique_lca(self):
Test error when one revision is not in the graph
def test_lca_criss_cross(self):
Test least-common-ancestor after a criss-cross merge.
def test_lca_shortcut(self):
Test least-common ancestor on this history shortcut
def test_lefthand_distance_smoke(self):
A simple does it work test for graph.lefthand_distance(keys).
def test_lefthand_distance_ghosts(self):
A simple does it work test for graph.lefthand_distance(keys).
def test_recursive_unique_lca(self):
Test finding a unique least common ancestor.

ancestry_1 should always have a single common ancestor

def assertRemoveDescendants(self, expected, graph, revisions):
Undocumented
def test__remove_simple_descendants(self):
Undocumented
def test__remove_simple_descendants_disjoint(self):
Undocumented
def test__remove_simple_descendants_chain(self):
Undocumented
def test__remove_simple_descendants_siblings(self):
Undocumented
def test_unique_lca_criss_cross(self):
Ensure we don't pick non-unique lcas in a criss-cross
def test_unique_lca_null_revision(self):
Ensure we pick NULL_REVISION when necessary
def test_unique_lca_null_revision2(self):
Ensure we pick NULL_REVISION when necessary
def test_lca_double_shortcut(self):
Undocumented
def test_common_ancestor_two_repos(self):
Ensure we do unique_lca using data from two repos
def test_graph_difference(self):
Undocumented
def test_graph_difference_separate_ancestry(self):
Undocumented
def test_graph_difference_criss_cross(self):
Undocumented
def test_graph_difference_extended_history(self):
Undocumented
def test_graph_difference_double_shortcut(self):
Undocumented
def test_graph_difference_complex_shortcut(self):
Undocumented
def test_graph_difference_complex_shortcut2(self):
Undocumented
def test_graph_difference_shortcut_extra_root(self):
Undocumented
def test_iter_topo_order(self):
Undocumented
def test_is_ancestor(self):
Undocumented
def test_is_between(self):
Undocumented
def test_is_ancestor_boundary(self):
Ensure that we avoid searching the whole graph.

This requires searching through b as a common ancestor, so we can identify that e is common.

def test_iter_ancestry(self):
Undocumented
def test_iter_ancestry_with_ghost(self):
Undocumented
def test_filter_candidate_lca(self):
Test filter_candidate_lca for a corner case

This tests the case where we encounter the end of iteration for 'e' in the same pass as we discover that 'd' is an ancestor of 'e', and therefore 'e' can't be an lca.

To compensate for different dict orderings on other Python implementations, we mirror 'd' and 'e' with 'b' and 'a'.

def test_heads_null(self):
Undocumented
def test_heads_one(self):
Undocumented
def test_heads_single(self):
Undocumented
def test_heads_two_heads(self):
Undocumented
def test_heads_criss_cross(self):
Undocumented
def test_heads_shortcut(self):
Undocumented
def _run_heads_break_deeper(self, graph_dict, search):
Run heads on a graph-as-a-dict.

If the search asks for the parents of 'deeper' the test will fail.

def test_heads_limits_search(self):
Undocumented
def test_heads_limits_search_assymetric(self):
Undocumented
def test_heads_limits_search_common_search_must_continue(self):
Undocumented
def test_breadth_first_search_start_ghosts(self):
Undocumented
def test_breadth_first_search_deep_ghosts(self):
Undocumented
def test_breadth_first_search_change_next_to_next_with_ghosts(self):
Undocumented
def test_breadth_first_change_search(self):
Undocumented
def assertSeenAndResult(self, instructions, search, next):
Check the results of .seen and get_result() for a seach.
ParametersinstructionsA list of tuples: (seen, recipe, included_keys, starts, stops). seen, recipe and included_keys are results to check on the search and the searches get_result(). starts and stops are parameters to pass to start_searching and stop_searching_any during each iteration, if they are not None.
searchThe search to use.
nextA callable to advance the search.
def test_breadth_first_get_result_excludes_current_pending(self):
Undocumented
def test_breadth_first_get_result_starts_stops(self):
Undocumented
def test_breadth_first_stop_searching_not_queried(self):
Undocumented
def test_breadth_first_stop_searching_late(self):
Undocumented
def test_breadth_first_get_result_ghosts_are_excluded(self):
Undocumented
def test_breadth_first_get_result_starting_a_ghost_ghost_is_excluded(self):
Undocumented
def test_breadth_first_revision_count_includes_NULL_REVISION(self):
Undocumented
def test_breadth_first_search_get_result_after_StopIteration(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2021-09-19 00:23:32.