Part of bzrlib.tests View In Hierarchy
Known subclasses: bzrlib.plugins.launchpad.test_account.CheckAccountTests, bzrlib.plugins.launchpad.test_lp_api_lite.Test_GetNewestVersions, bzrlib.plugins.launchpad.test_lp_api_lite.TestGetMostRecentTag, bzrlib.plugins.launchpad.test_lp_api_lite.TestReportFreshness, bzrlib.plugins.launchpad.test_lp_directory.DirectoryOpenBranchTests, bzrlib.tests.blackbox.test_export_pot.TestExportPot, bzrlib.tests.blackbox.test_serve.TestUserdirExpansion, bzrlib.tests.per_branch.test_hooks.ChangeBranchTipTestCase, bzrlib.tests.per_branch.test_hooks.TestOpen, bzrlib.tests.per_inventory.TestCaseWithInventory, bzrlib.tests.per_versionedfile.TestContentFactoryAdaption, bzrlib.tests.per_versionedfile.TestKeyMapper, bzrlib.tests.per_versionedfile.TestOrderingVersionedFilesDecorator, bzrlib.tests.per_versionedfile.TestPlanMergeVersionedFile, bzrlib.tests.per_versionedfile.TestVersionedFiles, bzrlib.tests.per_versionedfile.TestWeave, bzrlib.tests.per_versionedfile.TestWeaveMerge, bzrlib.tests.script.TestCaseWithMemoryTransportAndScript, bzrlib.tests.test__annotator.TestAnnotator, bzrlib.tests.test_ancestry.TestAncestry, bzrlib.tests.test_branchbuilder.TestBranchBuilder, bzrlib.tests.test_branchbuilder.TestBranchBuilderBuildSnapshot, bzrlib.tests.test_bugtracker.TestBuiltinTrackers, bzrlib.tests.test_bugtracker.TestGetBugURL, bzrlib.tests.test_bugtracker.TestUniqueIntegerBugTracker, bzrlib.tests.test_bugtracker.TestURLParametrizedBugTracker, bzrlib.tests.test_bugtracker.TestURLParametrizedIntegerBugTracker, bzrlib.tests.test_bzrdir.TestBzrDirHooks, bzrlib.tests.test_bzrdir.TestBzrDirSprout, bzrlib.tests.test_bzrdir.TestGenerateBackupName, bzrlib.tests.test_bzrdir.TestMissingRepoBranchesSkipped, bzrlib.tests.test_chk_map.TestCaseWithStore, bzrlib.tests.test_graph.TestGraph, bzrlib.tests.test_graph.TestPendingAncestryResultGetKeys, bzrlib.tests.test_groupcompress.TestCaseWithGroupCompressVersionedFiles, bzrlib.tests.test_index.TestCombinedGraphIndex, bzrlib.tests.test_index.TestGraphIndex, bzrlib.tests.test_index.TestGraphIndexBuilder, bzrlib.tests.test_index.TestGraphIndexPrefixAdapter, bzrlib.tests.test_index.TestInMemoryGraphIndex, bzrlib.tests.test_inv.TestCHKInventory, bzrlib.tests.test_inv.TestCHKInventoryExpand, bzrlib.tests.test_knit.Test_KnitAnnotator, bzrlib.tests.test_knit.TestKnitKnitAccess, bzrlib.tests.test_knit.TestPackKnitAccess, bzrlib.tests.test_merge.TestMergerBase, bzrlib.tests.test_merge.TestPlanMerge, bzrlib.tests.test_remote.TestErrorTranslationBase, bzrlib.tests.test_remote.TestRemote, bzrlib.tests.test_repository.Test2a, bzrlib.tests.test_repository.TestKnitPackStreamSource, bzrlib.tests.test_selftest.TestTestCaseWithMemoryTransport, bzrlib.tests.test_smart.GetStreamTestBase, bzrlib.tests.test_smart.SmartTCPServerHookTests, bzrlib.tests.test_smart.TestCaseWithSmartMedium, bzrlib.tests.test_smart.TestInsertStreamBase, bzrlib.tests.test_smart.TestLockedBranch, bzrlib.tests.test_smart.TestSmartServerBranchRequest, bzrlib.tests.test_smart.TestSmartServerBranchRequestGetConfigFile, bzrlib.tests.test_smart.TestSmartServerBranchRequestGetParent, bzrlib.tests.test_smart.TestSmartServerBranchRequestGetStackedOnURL, bzrlib.tests.test_smart.TestSmartServerBranchRequestGetTagsBytes, bzrlib.tests.test_smart.TestSmartServerBranchRequestLastRevisionInfo, bzrlib.tests.test_smart.TestSmartServerBzrDirRequestCloningMetaDir, bzrlib.tests.test_smart.TestSmartServerBzrDirRequestGetConfigFile, bzrlib.tests.test_smart.TestSmartServerIsReadonly, bzrlib.tests.test_smart.TestSmartServerRepositoryGatherStats, bzrlib.tests.test_smart.TestSmartServerRepositoryGetParentMap, bzrlib.tests.test_smart.TestSmartServerRepositoryGetRevIdForRevno, bzrlib.tests.test_smart.TestSmartServerRepositoryGetRevisionGraph, bzrlib.tests.test_smart.TestSmartServerRepositoryIsShared, bzrlib.tests.test_smart.TestSmartServerRepositoryLockWrite, bzrlib.tests.test_smart.TestSmartServerRepositoryRequest, bzrlib.tests.test_smart.TestSmartServerRepositorySetMakeWorkingTrees, bzrlib.tests.test_smart.TestSmartServerRepositoryUnlock, bzrlib.tests.test_smart.TestSmartServerRequest, bzrlib.tests.test_smart.TestSmartServerRequestBzrDirInitializeEx, bzrlib.tests.test_smart.TestSmartServerRequestCreateRepository, bzrlib.tests.test_smart.TestSmartServerRequestFindRepository, bzrlib.tests.test_smart.TestSmartServerRequestHasRevision, bzrlib.tests.test_smart.TestSmartServerRequestInitializeBzrDir, bzrlib.tests.test_smart.TestSmartServerRequestOpenBzrDir, bzrlib.tests.test_smart.TestSmartServerRequestOpenBzrDir_2_1, bzrlib.tests.test_smart.TestSmartServerRequestRevisionHistory, bzrlib.tests.test_smart.TestSmartServerVfsGet, bzrlib.tests.test_smart_request.TestJailHook, bzrlib.tests.test_smart_request.TestRequestJail, bzrlib.tests.test_transport_log.TestTransportLog, bzrlib.tests.test_treebuilder.TestTreeBuilderMemoryTree, bzrlib.tests.test_versionedfile.Test_MPDiffGenerator, bzrlib.tests.test_wsgi.TestWSGIJail, bzrlib.tests.TestCaseInTempDir
Tests that need disk resources should derive from TestCaseInTempDir orTestCaseWithTransport.
TestCaseWithMemoryTransport sets the TEST_ROOT variable for all bzr tests.
For TestCaseWithMemoryTransport the test_home_dir is set to the name of a directory which does not exist. This serves to help ensure test isolation is preserved. test_dir is set to the TEST_ROOT, as is cwd, because they must exist. However, TestCaseWithMemoryTransport does not offer local file defaults for the transport in tests, nor does it obey the command line override, so tests that accidentally write to the common directory should be rare.
Class Variables | TEST_ROOT | Directory containing all temporary directories, plus a .bzr directory that stops us ascending higher into the filesystem. |
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:
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. |
This transport is for the test scratch space relative to "self._test_root"
Parameters | relpath | a path relative to the base url. |
This can be used to test that operations which should only need readonly access in fact do not try to write.
Parameters | relpath | a path relative to the base url. |
This is mostly a hook for daughter classes.
This is useful for some tests with specific servers to do diagnostics.
This will either be backed by '.' or a decorator to the transport used by self.get_url() relpath provides for clients to get a path relative to the base url. These should only be downwards relative, not upwards.
This is useful for some tests with specific servers that need diagnostics.
For TestCaseWithMemoryTransport this is always a MemoryServer, and there is no means to override it.
This is useful for some tests with specific servers that need diagnostics.
This is built from the self.transport_server factory. If that is None, then the self.get_vfs_server is returned.
This will either be backed by '.' or to an equivalent non-file based facility. relpath provides for clients to get a path relative to the base url. These should only be downwards relative, not upwards.
This will either be backed by '.' or to an equivalent non-file based facility. relpath provides for clients to get a path relative to the base url. These should only be downwards relative, not upwards.
This will never be a smart protocol. It always has all the capabilities of the local filesystem, but it might actually be a MemoryTransport or some other similar virtual filesystem.
This is the backing transport (if any) of the server returned by get_url and get_readonly_url.
Parameters | relpath | provides for clients to get a path relative to the base url. These should only be downwards relative, not upwards. |
Returns | A URL |
This prevents any tests propagating up onto the TEST_ROOT directory's real branch.
_make_test_root have created a .bzr directory to prevent tests from propagating. This method ensures than a test did not leaked.
This must set self.test_home_dir and self.test_dir and chdir to self.test_dir.
For TestCaseWithMemoryTransport we chdir to the TEST_ROOT for this test.
Resolve an object to a ControlDir format object. The initial format object can either already be a ControlDirFormat, None (for the default format), or a string with the name of the control dir format. :param format: Object to resolve :return A ControlDirFormat instance
Note that relpath must be a relative path, not a full url.