25
25
from testsweet import TestBase
26
26
from weave import Weave, VerInfo, WeaveFormatError
27
from pprint import pformat
28
29
# XXX: If we do weaves this way, will a merge still behave the same
29
30
# way if it's done in a different order? That's a pretty desirable
485
481
"alternative second line"])
485
class ReplaceLine(TestBase):
489
text0 = ['cheddar', 'stilton', 'gruyere']
490
text1 = ['cheddar', 'blue vein', 'neufchatel', 'chevre']
495
self.log('k._l=' + pformat(k._l))
497
self.assertEqual(k.get(1), text1)
502
class Khayyam(TestBase):
505
"""A Book of Verses underneath the Bough,
506
A Jug of Wine, a Loaf of Bread, -- and Thou
507
Beside me singing in the Wilderness --
508
Oh, Wilderness were Paradise enow!""",
510
"""A Book of Verses underneath the Bough,
511
A Jug of Wine, a Loaf of Bread, -- and Thou
512
Beside me singing in the Wilderness --
513
Oh, Wilderness were Paradise now!""",
515
texts = [[l.strip() for l in t.split('\n')] for t in rawtexts]
520
ver = k.add(parents, t)
523
for i, t in enumerate(texts):
524
self.assertEqual(k.get(i),
489
531
from unittest import TestSuite, TestLoader
492
534
tl = TestLoader()
493
535
suite = TestSuite()
494
536
suite.addTest(tl.loadTestsFromModule(testweave))