99
1010
1111def 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
1919def strip (string ):
20- return re .sub ('\s+' , '' , string )
20+ return re .sub (u '\s+' , u '' , string )
2121
2222
2323def assert_output_eq (args , expected ):
2424 assert strip (run_cli (args ).output ) == strip (expected )
2525
2626
2727def 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
4949def 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
6363def 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
9292def test_query ():
93- assert_output_eq (['query' , 'true' ], '[]' )
93+ assert_output_eq ([u 'query' , u 'true' ], u '[]' )
0 commit comments