/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 tests/test_processor.py

fix symlink importing

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
        changes = revtree2.changes_from(revtree1)
152
152
        self.check_changes(changes, expected_renamed=[(old_path, new_path)],
153
153
            expected_added=[('b',)])
 
154
 
 
155
 
 
156
class TestFileKinds(tests.TestCaseWithTransport):
 
157
 
 
158
    def get_handler(self):
 
159
        branch = self.make_branch('.')
 
160
        handler = generic_processor.GenericProcessor(branch.bzrdir)
 
161
        return (handler, branch)
 
162
 
 
163
    def get_command_iter(self, path, kind, content):
 
164
        def command_list():
 
165
            committer = ['', 'elmer@a.com', time.time(), time.timezone]
 
166
            def files_one():
 
167
                yield commands.FileModifyCommand(path, kind, False,
 
168
                        None, content)
 
169
            yield commands.CommitCommand('head', '1', None,
 
170
                committer, "commit 1", None, [], files_one)
 
171
        return command_list
 
172
 
 
173
    def test_import_plainfile(self):
 
174
        (handler, branch) = self.get_handler()
 
175
        command_list = self.get_command_iter('foo', 'file', 'aaa')
 
176
 
 
177
    def test_import_symlink(self):
 
178
        (handler, branch) = self.get_handler()
 
179
        command_list = self.get_command_iter('foo', 'symlink', 'bar')
 
180
        handler.process(command_list)