~bzr-upload-devs/bzr-upload/trunk

« back to all changes in this revision

Viewing changes to tests/test_auto_upload_hook.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-15 20:53:45 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20120315205345-6ilssa714tfcrntk
Migrate to config stacks

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2011, 2012 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
46
46
    def setUp(self):
47
47
        super(AutoPushWithLocation, self).setUp()
48
48
        self.make_start_branch()
49
 
        cmds.set_upload_auto(self.wt.branch, True)
50
 
        cmds.set_upload_location(self.wt.branch, self.get_url('target'))
51
 
        cmds.set_upload_auto_quiet(self.wt.branch, 'True')
 
49
        conf = self.wt.branch.get_config_stack()
 
50
        conf.set('upload_auto', True)
 
51
        conf.set('upload_location', self.get_url('target'))
 
52
        conf.set('upload_auto_quiet', True)
52
53
 
53
54
    def test_auto_push_on_commit(self):
54
55
        self.assertPathDoesNotExist('target')
64
65
        self.build_tree(['b'])
65
66
        self.wt.add(['b'])
66
67
        self.wt.commit("two")
67
 
        cmds.set_upload_auto(self.wt.branch, False)
 
68
        self.wt.branch.get_config_stack().set('upload_auto', False)
68
69
        self.build_tree(['c'])
69
70
        self.wt.add(['c'])
70
71
        self.wt.commit("three")
76
77
    def setUp(self):
77
78
        super(AutoPushWithoutLocation, self).setUp()
78
79
        self.make_start_branch()
79
 
        cmds.set_upload_auto(self.wt.branch, True)
 
80
        self.wt.branch.get_config_stack().set('upload_auto', True)
80
81
 
81
82
    def test_dont_push_if_no_location(self):
82
83
        self.assertPathDoesNotExist('target')