Skip to content

Commit

Permalink
Fix CI (MacOS)
Browse files Browse the repository at this point in the history
MacOS's regcomp doesn't support \d
  • Loading branch information
jdavid committed Jan 22, 2021
1 parent 398d8d6 commit a2c6874
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,30 +147,29 @@ def test_multivar():
config.add_file(CONFIG_FILENAME, 6)
assert 'this.that' in config

assert 2 == len(list(config.get_multivar('this.that')))
l = list(config.get_multivar('this.that'))
assert ['foobar', 'foobeer'] == l
l = list(config.get_multivar('this.that', 'bar'))
assert 1 == len(l)
assert l[0] == 'foobar'
assert ['foobar'] == l

l = config.get_multivar('this.that', 'foo.*')
assert 2 == len(list(l))
l = list(config.get_multivar('this.that', 'foo.*'))
assert ['foobar', 'foobeer'] == l

config.set_multivar('this.that', '^.*beer', 'fool')
l = list(config.get_multivar('this.that', 'fool'))
assert len(l) == 1
assert l[0] == 'fool'
assert ['fool'] == l

config.set_multivar('this.that', 'foo.*', 'foo-123456')
l = list(config.get_multivar('this.that', 'foo.*'))
assert ['foo-123456', 'foo-123456'] == l

config.delete_multivar('this.that', 'bar')
l = list(config.get_multivar('this.that', ''))
assert 2 == len(l)
assert ['foo-123456', 'foo-123456'] == l

config.delete_multivar('this.that', r'foo-\d+')
l = config.get_multivar('this.that', '')
assert 0 == len(list(l))
config.delete_multivar('this.that', 'foo-[0-9]+')
l = list(config.get_multivar('this.that', ''))
assert [] == l

def test_iterator(config):
lst = {}
Expand Down

0 comments on commit a2c6874

Please sign in to comment.