Example #1
0
 def test_sampleregexp_correct_indexed_key(self):
     rd = SampleRegexp(os.path.join("(?P<SM>[A-Za-z0-9]+)", "(?:[A-Z0-9]+)_(?P<PU2>[0-9]+)_(?P<PU1>[0-9]+)"))
     assert rd.fmt == "{SM}/{PU2}_{PU1}"
     rd.parse("BAR/FOO_007_1")
     assert rd == {'PATH': 'BAR', 'PU': '1_007', 'PU2': '007', 'PU1': '1', 'SM' : 'BAR'}
Example #2
0
 def test_sampleregexp_parse_unable(self):
     rd = SampleRegexp("(?:[A-Z0-9]+)_(?P<SM>[A-Za-z0-9]+)")
     assert rd.parse("bar/foo_007") == {}