Skip to content

Commit 1f38bd1

Browse files
authored
Merge pull request #109 from engstrom/feature/localhost-file-parsing
Allow hypens in 'localhost mode' file values.
2 parents 7efaa33 + bde34fb commit 1f38bd1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

splitio/brokers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def destroy(self):
381381
class LocalhostBroker(BaseBroker):
382382
_COMMENT_LINE_RE = re.compile('^#.*$')
383383
_DEFINITION_LINE_RE = re.compile(
384-
'^(?<![^#])(?P<feature>[\w_]+)\s+(?P<treatment>[\w_]+)$'
384+
'^(?<![^#])(?P<feature>[\w_-]+)\s+(?P<treatment>[\w_-]+)$'
385385
)
386386

387387
class LocalhostEventStorage(object):

splitio/tests/test_clients.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,10 @@ def test_skips_illegal_lines(self):
11831183
def test_parses_definition_lines(self):
11841184
"""Test that _parse_split_file skips comment lines"""
11851185
self.open_mock.return_value.__enter__.return_value.__iter__.return_value = [
1186-
'feature1 treatment1', 'feature2 treatment2']
1186+
'feature1 treatment1', 'feature-2 treatment-2']
11871187
self.broker._parse_split_file(self.some_file_name)
11881188
self.assertListEqual([mock.call('feature1', 'treatment1'),
1189-
mock.call('feature2', 'treatment2')],
1189+
mock.call('feature-2', 'treatment-2')],
11901190
self.all_keys_split_mock.call_args_list)
11911191

11921192
def test_returns_dict_with_parsed_splits(self):

0 commit comments

Comments
 (0)