Skip to content

Commit edec157

Browse files
committed
Merge branch 'aviau-pthon-click-5'
2 parents 0bfc5a8 + 65dc707 commit edec157

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727

2828
install_requires=[
29-
'click>=3.1',
29+
'click>=3.1,<6.0',
3030
protobuf
3131
],
3232

tests/test_riemann_command.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@
99

1010

1111
def run_cli(args):
12-
args = ['-T', 'none'] + list(args)
12+
args = [u'-T', u'none'] + list(args)
1313
runner = click.testing.CliRunner()
1414
result = runner.invoke(riemann_client.command.main, args)
1515
assert result.exit_code == 0
1616
return result
1717

1818

1919
def strip(string):
20-
return re.sub('\s+', '', string)
20+
return re.sub(u'\s+', u'', string)
2121

2222

2323
def assert_output_eq(args, expected):
2424
assert strip(run_cli(args).output) == strip(expected)
2525

2626

2727
def test_send_empty_message():
28-
assert_output_eq(['send'], '{"host": "%s"}' % socket.gethostname())
28+
assert_output_eq([u'send'], u'{"host": "%s"}' % socket.gethostname())
2929

3030

31-
POPULATED_MESSAGE = """{
31+
POPULATED_MESSAGE = u"""{
3232
"attributes": {
3333
"key": "value"
3434
},
@@ -48,29 +48,29 @@ def test_send_empty_message():
4848

4949
def test_send():
5050
assert_output_eq([
51-
'send',
52-
'--attribute', 'key=value',
53-
'--description', 'description',
54-
'--metric_f', '11.1',
55-
'--service', 'service',
56-
'--state', 'state',
57-
'--tag', 'tag',
58-
'--time', '1408030991',
59-
'--ttl', '120'
51+
u'send',
52+
u'--attribute', u'key=value',
53+
u'--description', u'description',
54+
u'--metric_f', u'11.1',
55+
u'--service', u'service',
56+
u'--state', u'state',
57+
u'--tag', u'tag',
58+
u'--time', u'1408030991',
59+
u'--ttl', u'120'
6060
], POPULATED_MESSAGE)
6161

6262

6363
def test_send_short():
6464
assert_output_eq([
65-
'send',
66-
'-a', 'key=value',
67-
'-d', 'description',
68-
'-m', '11.1',
69-
'-s', 'service',
70-
'-S', 'state',
71-
'-t', 'tag',
72-
'-T', '1408030991',
73-
'-l', '120'
65+
u'send',
66+
u'-a', u'key=value',
67+
u'-d', u'description',
68+
u'-m', u'11.1',
69+
u'-s', u'service',
70+
u'-S', u'state',
71+
u'-t', u'tag',
72+
u'-T', u'1408030991',
73+
u'-l', u'120'
7474
], POPULATED_MESSAGE)
7575

7676

@@ -90,4 +90,4 @@ def test_send_noecho():
9090

9191

9292
def test_query():
93-
assert_output_eq(['query', 'true'], '[]')
93+
assert_output_eq([u'query', u'true'], u'[]')

0 commit comments

Comments
 (0)