/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_upload.py

(jelmer) More lazy loading

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
18
 
import stat
19
18
import sys
20
19
 
21
20
 
22
21
from bzrlib import (
23
 
    branch,
24
22
    bzrdir,
25
23
    config,
26
24
    errors,
27
25
    osutils,
28
 
    remote,
29
26
    revisionspec,
30
27
    tests,
31
28
    transport,
32
29
    workingtree,
33
30
    uncommit,
34
31
    )
35
 
from bzrlib.smart import server as smart_server
36
32
from bzrlib.tests import (
37
33
    per_branch,
38
34
    per_transport,
42
38
    ftp,
43
39
    sftp,
44
40
    )
45
 
from bzrlib.plugins import upload
 
41
from bzrlib.plugins.upload import (
 
42
    cmds,
 
43
    )
46
44
 
47
45
 
48
46
def get_transport_scenarios():
213
211
        self.tree.commit('modify symlink %s -> %s' % (path, target))
214
212
 
215
213
    def _get_cmd_upload(self):
216
 
        cmd = upload.cmd_upload()
 
214
        cmd = cmds.cmd_upload()
217
215
        # We don't want to use run_bzr here because redirected output are a
218
216
        # pain to debug. But we need to provides a valid outf.
219
217
        # XXX: Should a bug against bzr be filled about that ?
452
450
        self.failIfUpFileExists(new_name)
453
451
 
454
452
    def get_upload_auto(self):
455
 
        return upload.get_upload_auto(self.tree.branch)
 
453
        return cmds.get_upload_auto(self.tree.branch)
456
454
 
457
455
    def test_upload_auto(self):
458
456
        """Test that upload --auto sets the upload_auto option"""
503
501
        self.add_file('dir/goodbye', 'baz')
504
502
 
505
503
        revid_path = 'dir/revid-path'
506
 
        upload.set_upload_revid_location(self.tree.branch, revid_path)
 
504
        cmds.set_upload_revid_location(self.tree.branch, revid_path)
507
505
        self.failIfUpFileExists(revid_path)
508
506
 
509
507
        self.do_full_upload()
618
616
 
619
617
        self.do_full_upload()
620
618
 
621
 
        revid_path = upload.get_upload_revid_location(self.tree.branch)
 
619
        revid_path = cmds.get_upload_revid_location(self.tree.branch)
622
620
        self.failUnlessUpFileExists(revid_path)
623
621
 
624
622
    def test_invalid_revspec(self):
725
723
        self.make_branch_and_working_tree()
726
724
        self.add_file('hello', 'bar')
727
725
 
728
 
        revid_path = upload.get_upload_revid_location(self.tree.branch)
 
726
        revid_path = cmds.get_upload_revid_location(self.tree.branch)
729
727
        self.failIfUpFileExists(revid_path)
730
728
 
731
729
        self.do_upload()
800
798
        up_url = self.get_url(self.branch_dir)
801
799
        # Let's try to upload from the just created remote branch into the
802
800
        # branch (which has a working tree).
803
 
        self.assertRaises(upload.CannotUploadToWorkingTree,
 
801
        self.assertRaises(cmds.CannotUploadToWorkingTree,
804
802
                          cmd.run, up_url, directory=self.remote_branch_url)
805
803
 
806
804
    def test_upload_without_working_tree(self):
831
829
        self.assertEqual(revid, uploaded_revid)
832
830
 
833
831
    def test_cant_upload_diverged(self):
834
 
        self.assertRaises(upload.DivergedUploadedTree,
 
832
        self.assertRaises(cmds.DivergedUploadedTree,
835
833
                          self.do_incremental_upload,
836
834
                          directory=self.diverged_tree.basedir)
837
835
        self.assertRevidUploaded('rev2a')
852
850
        t.put_bytes('.bzr-upload.revid', 'fake')
853
851
        # Make a change
854
852
        self.add_file('foo', 'bar\n')
855
 
        self.assertRaises(upload.DivergedUploadedTree, self.do_full_upload)
 
853
        self.assertRaises(cmds.DivergedUploadedTree, self.do_full_upload)
856
854