~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lock.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-16 19:18:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6391.
  • Revision ID: jelmer@samba.org-20111216191839-eg681lxqibi1qxu1
Fix remaining tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
17
17
"""Tests for OS Locks."""
18
18
 
19
19
 
20
 
 
21
20
from bzrlib import (
22
21
    debug,
23
22
    errors,
24
23
    lock,
25
24
    tests,
26
25
    )
27
 
 
28
 
 
29
 
def load_tests(standard_tests, module, loader):
30
 
    """Parameterize tests for all versions of groupcompress."""
31
 
    scenarios = []
32
 
    for name, write_lock, read_lock in lock._lock_classes:
33
 
        scenarios.append((name, {'write_lock': write_lock,
34
 
                                 'read_lock': read_lock}))
35
 
    suite = loader.suiteClass()
36
 
    result = tests.multiply_tests(standard_tests, scenarios, suite)
37
 
    return result
 
26
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
27
 
 
28
 
 
29
load_tests = load_tests_apply_scenarios
38
30
 
39
31
 
40
32
class TestOSLock(tests.TestCaseInTempDir):
41
33
 
42
 
    # Set by load_tests
 
34
    scenarios = [(
 
35
        name, {
 
36
            'write_lock': write_lock,
 
37
            'read_lock': read_lock})
 
38
        for name, write_lock, read_lock in lock._lock_classes]
 
39
 
43
40
    read_lock = None
44
41
    write_lock = None
45
42