Show More
@@ -20,11 +20,19 b' try:' | |||||
20 | lm = lazymanifest(mdata) |
|
20 | lm = lazymanifest(mdata) | |
21 | # iterate the whole thing, which causes the code to fully parse |
|
21 | # iterate the whole thing, which causes the code to fully parse | |
22 | # every line in the manifest |
|
22 | # every line in the manifest | |
23 |
|
|
23 | for e, _, _ in lm.iterentries(): | |
|
24 | # also exercise __getitem__ et al | |||
|
25 | lm[e] | |||
|
26 | e in lm | |||
|
27 | (e + 'nope') in lm | |||
24 | lm[b'xyzzy'] = (b'\0' * 20, 'x') |
|
28 | lm[b'xyzzy'] = (b'\0' * 20, 'x') | |
25 | # do an insert, text should change |
|
29 | # do an insert, text should change | |
26 | assert lm.text() != mdata, "insert should change text and didn't: %r %r" % (lm.text(), mdata) |
|
30 | assert lm.text() != mdata, "insert should change text and didn't: %r %r" % (lm.text(), mdata) | |
|
31 | cloned = lm.filtercopy(lambda x: x != 'xyzzy') | |||
|
32 | assert cloned.text() == mdata, 'cloned text should equal mdata' | |||
|
33 | cloned.diff(lm) | |||
27 | del lm[b'xyzzy'] |
|
34 | del lm[b'xyzzy'] | |
|
35 | cloned.diff(lm) | |||
28 | # should be back to the same |
|
36 | # should be back to the same | |
29 | assert lm.text() == mdata, "delete should have restored text but didn't: %r %r" % (lm.text(), mdata) |
|
37 | assert lm.text() == mdata, "delete should have restored text but didn't: %r %r" % (lm.text(), mdata) | |
30 | except Exception as e: |
|
38 | except Exception as e: |
General Comments 0
You need to be logged in to leave comments.
Login now