~jelmer/loggerhead/breezy-compat

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_controllers.py

  • Committer: Jelmer Vernooij
  • Date: 2019-09-21 22:50:23 UTC
  • Revision ID: jelmer@jelmer.uk-20190921225023-esteo4f1jxtbp1fy
Avoid relying on file ids.

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
        builder = self.make_branch_builder('branch')
248
248
        builder.start_series()
249
249
        rev1 = builder.build_snapshot(None, [
250
 
            ('add', ('', b'root-id', 'directory', '')),
251
 
            ('add', ('filename', b'f-id', 'file', b'content\n'))],
 
250
            ('add', ('', None, 'directory', '')),
 
251
            ('add', ('filename', None, 'file', b'content\n'))],
252
252
            message="First commit.")
253
253
        rev2 = builder.build_snapshot(None, [
254
254
             ('modify', ('filename', b'new content\n'))])
260
260
    def test_get_values_smoke(self):
261
261
        branch_app, (rev1, rev2) = self.make_branch_app_for_filediff_ui()
262
262
        env = {'SCRIPT_NAME': '/',
263
 
               'PATH_INFO': '/+filediff/%s/%s/f-id' % (rev2.decode('utf-8'), rev1.decode('utf-8')),
 
263
               'PATH_INFO': '/+filediff/%s/%s/filename' % (rev2.decode('utf-8'), rev1.decode('utf-8')),
264
264
               'REQUEST_METHOD': 'GET',
265
265
               'wsgi.url_scheme': 'http',
266
266
               'SERVER_NAME': 'localhost',
275
275
    def test_json_render_smoke(self):
276
276
        branch_app, (rev1, rev2) = self.make_branch_app_for_filediff_ui()
277
277
        env = {'SCRIPT_NAME': '/',
278
 
               'PATH_INFO': '/+json/+filediff/%s/%s/f-id' % (rev2.decode('utf-8'), rev1.decode('utf-8')),
 
278
               'PATH_INFO': '/+json/+filediff/%s/%s/filename' % (rev2.decode('utf-8'), rev1.decode('utf-8')),
279
279
               'REQUEST_METHOD': 'GET',
280
280
               'wsgi.url_scheme': 'http',
281
281
               'SERVER_NAME': 'localhost',
290
290
        builder = self.make_branch_builder('branch')
291
291
        builder.start_series()
292
292
        revid = builder.build_snapshot(None, [
293
 
            ('add', ('', b'root-id', 'directory', '')),
294
 
            ('add', ('filename', b'f-id', 'file', b'content\n'))],
 
293
            ('add', ('', None, 'directory', '')),
 
294
            ('add', ('filename', None, 'file', b'content\n'))],
295
295
            message="First commit.")
296
296
        builder.finish_series()
297
297
        branch = builder.get_branch()