~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Alexander Belchenko
  • Date: 2007-09-20 21:46:15 UTC
  • mto: (2846.2.1 approved.branch5)
  • mto: This revision was merged to the branch mainline in revision 2848.
  • Revision ID: bialix@ukr.net-20070920214615-v1a3x1f05sgtrop2
provide non-empty locations.conf for test_branch.TestBranchFormat5.test_set_push_location

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
                                   ensure_config_dir_exists)
108
108
        ensure_config_dir_exists()
109
109
        fn = locations_config_filename()
 
110
        # write correct newlines to locations.conf
 
111
        # by default ConfigObj uses native line-endings for new files
 
112
        # but uses already existing line-endings if file is not empty
 
113
        f = open(fn, 'wb')
 
114
        try:
 
115
            f.write('# comment\n')
 
116
        finally:
 
117
            f.close()
 
118
 
110
119
        branch = self.make_branch('.', format='knit')
111
120
        branch.set_push_location('foo')
112
121
        local_path = urlutils.local_path_from_url(branch.base[:-1])
113
 
        self.assertFileEqual("[%s]\n"
 
122
        self.assertFileEqual("# comment\n"
 
123
                             "[%s]\n"
114
124
                             "push_location = foo\n"
115
125
                             "push_location:policy = norecurse" % local_path,
116
126
                             fn)