~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Patch Queue Manager
  • Date: 2012-06-20 15:48:57 UTC
  • mfrom: (6524.2.6 config-branchname)
  • Revision ID: pqm@pqm.ubuntu.com-20120620154857-e8a2fxwsgdxm87y1
(abentley) Add branchname config variable (Aaron Bentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for finding and reading the bzr config file[s]."""
18
18
# import system imports here
19
19
from cStringIO import StringIO
 
20
from textwrap import dedent
20
21
import os
21
22
import sys
22
23
import threading
3418
3419
        matcher = config.LocationMatcher(store, expected_url)
3419
3420
        self.assertEquals(expected_location, matcher.location)
3420
3421
 
 
3422
    def test_branch_name_colo(self):
 
3423
        store = self.get_store(self)
 
3424
        store._load_from_string(dedent("""\
 
3425
            [/]
 
3426
            push_location=my{branchname}
 
3427
        """))
 
3428
        matcher = config.LocationMatcher(store, 'file:///,branch=example%3c')
 
3429
        self.assertEqual('example<', matcher.branch_name)
 
3430
        ((_, section),) = matcher.get_sections()
 
3431
        self.assertEqual('example<', section.locals['branchname'])
 
3432
 
 
3433
    def test_branch_name_basename(self):
 
3434
        store = self.get_store(self)
 
3435
        store._load_from_string(dedent("""\
 
3436
            [/]
 
3437
            push_location=my{branchname}
 
3438
        """))
 
3439
        matcher = config.LocationMatcher(store, 'file:///parent/example%3c')
 
3440
        self.assertEqual('example<', matcher.branch_name)
 
3441
        ((_, section),) = matcher.get_sections()
 
3442
        self.assertEqual('example<', section.locals['branchname'])
 
3443
 
3421
3444
 
3422
3445
class TestStartingPathMatcher(TestStore):
3423
3446