~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_dirstate.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-03 02:37:39 UTC
  • mfrom: (2949.5.2 symlink.feature)
  • Revision ID: pqm@pqm.ubuntu.com-20071103023739-e0wzok4qpvzq66sa
selftest: use SymlinkFeature instead of TestSkipped where appropriate

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    osutils,
27
27
    )
28
28
from bzrlib.memorytree import MemoryTree
29
 
from bzrlib.osutils import has_symlinks
30
29
from bzrlib.tests import (
 
30
        SymlinkFeature,
31
31
        TestCase,
32
32
        TestCaseWithTransport,
33
 
        TestSkipped,
34
33
        )
35
34
 
36
35
 
1077
1076
        # The most trivial addition of a symlink when there are no parents and
1078
1077
        # its in the root and all data about the file is supplied
1079
1078
        # bzr doesn't support fake symlinks on windows, yet.
1080
 
        if not has_symlinks():
1081
 
            raise TestSkipped("No symlink support")
 
1079
        self.requireFeature(SymlinkFeature)
1082
1080
        os.symlink('target', 'a link')
1083
1081
        stat = os.lstat('a link')
1084
1082
        expected_entries = [
1598
1596
 
1599
1597
    def test_update_entry_symlink(self):
1600
1598
        """Update entry should read symlinks."""
1601
 
        if not osutils.has_symlinks():
1602
 
            # PlatformDeficiency / TestSkipped
1603
 
            raise TestSkipped("No symlink support")
 
1599
        self.requireFeature(SymlinkFeature)
1604
1600
        state, entry = self.get_state_with_a()
1605
1601
        state.save()
1606
1602
        self.assertEqual(dirstate.DirState.IN_MEMORY_UNMODIFIED,
1757
1753
 
1758
1754
    def test_update_file_to_symlink(self):
1759
1755
        """File becomes a symlink"""
1760
 
        if not osutils.has_symlinks():
1761
 
            # PlatformDeficiency / TestSkipped
1762
 
            raise TestSkipped("No symlink support")
 
1756
        self.requireFeature(SymlinkFeature)
1763
1757
        state, entry = self.get_state_with_a()
1764
1758
        # The file sha1 won't be cached unless the file is old
1765
1759
        state.adjust_time(+10)
1778
1772
 
1779
1773
    def test_update_dir_to_symlink(self):
1780
1774
        """Directory becomes a symlink"""
1781
 
        if not osutils.has_symlinks():
1782
 
            # PlatformDeficiency / TestSkipped
1783
 
            raise TestSkipped("No symlink support")
 
1775
        self.requireFeature(SymlinkFeature)
1784
1776
        state, entry = self.get_state_with_a()
1785
1777
        # The symlink target won't be cached if it isn't old
1786
1778
        state.adjust_time(+10)
1790
1782
 
1791
1783
    def test_update_symlink_to_file(self):
1792
1784
        """Symlink becomes a file"""
1793
 
        if not has_symlinks():
1794
 
            raise TestSkipped("No symlink support")
 
1785
        self.requireFeature(SymlinkFeature)
1795
1786
        state, entry = self.get_state_with_a()
1796
1787
        # The symlink and file info won't be cached unless old
1797
1788
        state.adjust_time(+10)
1801
1792
 
1802
1793
    def test_update_symlink_to_dir(self):
1803
1794
        """Symlink becomes a directory"""
1804
 
        if not has_symlinks():
1805
 
            raise TestSkipped("No symlink support")
 
1795
        self.requireFeature(SymlinkFeature)
1806
1796
        state, entry = self.get_state_with_a()
1807
1797
        # The symlink target won't be cached if it isn't old
1808
1798
        state.adjust_time(+10)