Fixtures can be created during a test as a way to separate out creation of
objects to test. Fixture objects can hold some state so that different
objects created during a test instance can be related. Normally a fixture
should live only for the duration of a single test, and its tearDown method
should be passed to addCleanup
on the test.
Function | generate_unicode_names | Generate a sequence of arbitrary unique unicode names. |
Function | generate_unicode_encodings | Return a generator of unicode encoding names. |
Class | RecordingContextManager | A context manager that records. |
Function | build_branch_with_non_ancestral_rev | Builds a branch with a rev not in the ancestry of the tip. |
Function | make_branch_and_populated_tree | Make a simple branch and tree. |
Generate a sequence of arbitrary unique unicode names.
By default they are not representable in ascii.
>>> gen = generate_unicode_names() >>> n1 = gen.next() >>> n2 = gen.next() >>> type(n1) <type 'unicode'> >>> n1 == n2 False >>> n1.encode('ascii', 'replace') == n1 False
Return a generator of unicode encoding names.
These can be passed to Python encode/decode/etc.
>>> n1 = generate_unicode_names().next() >>> enc = generate_unicode_encodings(universal_encoding=True).next() >>> enc2 = generate_unicode_encodings(universal_encoding=False).next() >>> n1.encode(enc).decode(enc) == n1 True >>> try: ... n1.encode(enc2).decode(enc2) ... except UnicodeError: ... print 'fail' fail
Parameters | universal_encoding | True/False/None tristate to say whether the generated encodings either can or cannot encode all unicode strings. |
This is the revision graph:
rev-2 | rev-1 | (null)
The branch tip is 'rev-1'. 'rev-2' is present in the branch's repository, but is not part of rev-1's ancestry.
Parameters | branch_builder | A BranchBuilder (e.g. from TestCaseWithMemoryTransport.make_branch_builder). |
Returns | the new branch |