/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/features.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    def feature_name(self):
70
70
        return 'symlinks'
71
71
 
 
72
 
72
73
SymlinkFeature = _SymlinkFeature()
73
74
 
74
75
 
80
81
    def feature_name(self):
81
82
        return 'hardlinks'
82
83
 
 
84
 
83
85
HardlinkFeature = _HardlinkFeature()
84
86
 
85
87
 
91
93
    def feature_name(self):
92
94
        return 'filesystem fifos'
93
95
 
 
96
 
94
97
OsFifoFeature = _OsFifoFeature()
95
98
 
96
99
 
115
118
            # for some reason.
116
119
            return True
117
120
 
 
121
 
118
122
UnicodeFilenameFeature = _UnicodeFilenameFeature()
119
123
 
120
124
 
254
258
            return True
255
259
        return False
256
260
 
 
261
 
257
262
ByteStringNamedFilesystem = _ByteStringNamedFilesystem()
258
263
 
259
264
 
265
270
            return True
266
271
        return False
267
272
 
 
273
 
268
274
UTF8Filesystem = _UTF8Filesystem()
269
275
 
270
276
 
303
309
            name = osutils.normpath(name)
304
310
            base, rel = osutils.split(name)
305
311
            found_rel = osutils.canonical_relpath(base, name)
306
 
            return (found_rel == rel
307
 
                    and os.path.isfile(name.upper())
308
 
                    and os.path.isfile(name.lower()))
 
312
            return (found_rel == rel and
 
313
                    os.path.isfile(name.upper()) and
 
314
                    os.path.isfile(name.lower()))
309
315
        finally:
310
316
            os.close(fileno)
311
317
            os.remove(name)
313
319
    def feature_name(self):
314
320
        return "case-insensitive case-preserving filesystem"
315
321
 
 
322
 
316
323
CaseInsCasePresFilenameFeature = _CaseInsCasePresFilenameFeature()
317
324
 
318
325
 
335
342
        else:
336
343
            root = tests.TestCaseWithMemoryTransport.TEST_ROOT
337
344
        tdir = osutils.mkdtemp(prefix='case-sensitive-probe-', suffix='',
338
 
            dir=root)
 
345
                               dir=root)
339
346
        name_a = osutils.pathjoin(tdir, 'a')
340
347
        name_A = osutils.pathjoin(tdir, 'A')
341
348
        os.mkdir(name_a)
346
353
    def feature_name(self):
347
354
        return 'case-insensitive filesystem'
348
355
 
 
356
 
349
357
CaseInsensitiveFilesystemFeature = _CaseInsensitiveFilesystemFeature()
350
358
 
351
359
 
362
370
    def feature_name(self):
363
371
        return 'case-sensitive filesystem'
364
372
 
 
373
 
365
374
# new coding style is for feature instances to be lowercase
366
375
case_sensitive_filesystem_feature = _CaseSensitiveFilesystemFeature()
367
376
 
412
421
    def feature_name(self):
413
422
        return "Filesystem treats '\\' as a directory separator."
414
423
 
 
424
 
415
425
backslashdir_feature = _BackslashDirSeparatorFeature()
416
426
 
417
427
 
421
431
    def _probe(self):
422
432
        return os.name == 'posix' and hasattr(os, 'chown')
423
433
 
 
434
 
424
435
chown_feature = _ChownFeature()
425
436
 
426
437
 
482
493
    def _probe(self):
483
494
        try:
484
495
            proc = subprocess.Popen(['strace'],
485
 
                stderr=subprocess.PIPE,
486
 
                stdout=subprocess.PIPE)
 
496
                                    stderr=subprocess.PIPE,
 
497
                                    stdout=subprocess.PIPE)
487
498
            proc.communicate()
488
499
            return True
489
500
        except OSError as e: