~diegosarmentero/ubuntuone-client/udf-issue

« back to all changes in this revision

Viewing changes to tests/syncdaemon/test_vm_helper.py

- Provide a get_home_dir() method to get a proper home dir in unicode environments (LP: #898640).
- Handle link creation with unicode paths (LP: #891173).

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
        os_helper.make_dir(dest_path)
94
94
        self.assertFalse(create_shares_link(source_path, dest_path))
95
95
 
 
96
    def test_create_shares_link_existing_destiny_with_lnk_extension(self):
 
97
        """Add the lnk extension to the end of the file like windows needs."""
 
98
        base = self.mktemp("test_create_shares_link_exists")
 
99
        source_path = os.path.join(base, "source")
 
100
        dest_path = os.path.join(base, "dest.lnk")
 
101
        os_helper.make_dir(dest_path)
 
102
        self.assertFalse(create_shares_link(source_path, dest_path))
 
103
 
96
104
    def test_create_shares_link_makes_the_link(self):
97
105
        """create_shares_link makes the link as expected."""
98
106
        base = self.mktemp("test_create_shares_link_makes_the_link")
111
119
        self.assertTrue(create_shares_link(source_path, dest_path))
112
120
        self.assertFalse(create_shares_link(source_path, dest_path))
113
121
 
 
122
    def test_create_shares_link_existing_source_with_lnk_extension(self):
 
123
        """Add the lnk extension to the end of the file like windows needs."""
 
124
        base = self.mktemp("test_create_shares_link_makes_the_link")
 
125
        source_path = os.path.join(base, "source")
 
126
        dest_path = os.path.join(base, "dest.lnk")
 
127
        os_helper.make_dir(source_path)
 
128
        self.assertTrue(create_shares_link(source_path, dest_path))
 
129
        self.assertFalse(create_shares_link(source_path, dest_path))
 
130
 
114
131
 
115
132
class GetShareDirNameTests(BaseVolumeManagerTests):
116
133