129
130
scenarios = scenarios.multiply_scenarios(vary_by_conflicts())
131
132
def test_stringification(self):
132
text = unicode(self.conflict)
133
text = text_type(self.conflict)
133
134
self.assertContainsString(text, self.conflict.path)
134
135
self.assertContainsString(text.lower(), "conflict")
135
136
self.assertContainsString(repr(self.conflict),
140
141
o = conflicts.Conflict.factory(**p.as_stanza().as_dict())
141
142
self.assertEqual(o, p)
143
self.assertIsInstance(o.path, unicode)
144
self.assertIsInstance(o.path, text_type)
145
146
if o.file_id is not None:
146
147
self.assertIsInstance(o.file_id, str)
148
149
conflict_path = getattr(o, 'conflict_path', None)
149
150
if conflict_path is not None:
150
self.assertIsInstance(conflict_path, unicode)
151
self.assertIsInstance(conflict_path, text_type)
152
153
conflict_file_id = getattr(o, 'conflict_file_id', None)
153
154
if conflict_file_id is not None:
175
176
def test_stringification(self):
176
177
for text, o in zip(example_conflicts.to_strings(), example_conflicts):
177
self.assertEqual(text, unicode(o))
178
self.assertEqual(text, text_type(o))
180
181
# FIXME: The shell-like tests should be converted to real whitebox tests... or
304
305
# Create an empty trunk
305
306
builder.build_snapshot(None, [
306
('add', ('', 'root-id', 'directory', ''))],
307
('add', (u'', b'root-id', 'directory', ''))],
307
308
revision_id=b'start')
308
309
# Add a minimal base content
309
310
base_actions = self._get_actions(self._base_actions)()
310
builder.build_snapshot(['start'], base_actions, revision_id=b'base')
311
builder.build_snapshot([b'start'], base_actions, revision_id=b'base')
311
312
# Modify the base content in branch
312
313
actions_other = self._get_actions(self._other['actions'])()
313
builder.build_snapshot(['base'], actions_other, revision_id=b'other')
314
builder.build_snapshot([b'base'], actions_other, revision_id=b'other')
314
315
# Modify the base content in trunk
315
316
actions_this = self._get_actions(self._this['actions'])()
316
builder.build_snapshot(['base'], actions_this, revision_id=b'this')
317
builder.build_snapshot([b'base'], actions_this, revision_id=b'this')
317
318
# builder.get_branch() tip is now 'this'
319
320
builder.finish_series()