Skip to content

Commit

Permalink
Merge branch 'ternaryproperties' of git://github.com/pepsiman/buildbo…
Browse files Browse the repository at this point in the history
…t into buildbot-0.8.7
  • Loading branch information
djmitche committed Sep 3, 2012
2 parents 24e5e45 + 7dd1dbc commit 6d951eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions master/buildbot/process/properties.py
Expand Up @@ -197,9 +197,9 @@ class _PropertyMap(object):
Privately-used mapping object to implement WithProperties' substitutions,
including the rendering of None as ''.
"""
colon_minus_re = re.compile(r"(.*):-(.*)")
colon_tilde_re = re.compile(r"(.*):~(.*)")
colon_plus_re = re.compile(r"(.*):\+(.*)")
colon_minus_re = re.compile(r"([^:]*):-([^:]*)")
colon_tilde_re = re.compile(r"([^:]*):~([^:]*)")
colon_plus_re = re.compile(r"([^:]*):\+([^:]*)")

colon_ternary_re = re.compile(r"""(?P<prop>.*) # the property to match
: # colon
Expand Down
9 changes: 9 additions & 0 deletions master/buildbot/test/unit/test_process_properties.py
Expand Up @@ -249,6 +249,15 @@ def testColonTernaryHashEmpty(self):
def testColonTernaryHashUnset(self):
return self.doTestSimpleWithProperties('%(prop_nosuch:#?.truish.falsish)s', 'falsish')

def testColonTernaryHashSetMinus(self):
return self.doTestSimpleWithProperties('%(prop_str:#?:-truish:falsish)s', '-truish')

def testColonTernaryHashSetTilde(self):
return self.doTestSimpleWithProperties('%(prop_str:#?:~truish:falsish)s', '~truish')

def testColonTernaryHashSetPlus(self):
return self.doTestSimpleWithProperties('%(prop_str:#?:+truish:falsish)s', '+truish')


def testClearTempValues(self):
d = self.doTestSimpleWithProperties('', '',
Expand Down

0 comments on commit 6d951eb

Please sign in to comment.