import json

from common import exec_command as _c


def test_version():
    c, o, e = _c(['riak-mesos', '--version'])
    assert c == 0
    assert e == b''


def test_help():
    c, o, e = _c(['riak-mesos'])
    assert c == 0
    assert e == b''
    c, o, e = _c(['riak-mesos', '--help'])
    assert c == 0
    assert e == b''
    c, o, e = _c(['riak-mesos', 'config', '--help'])
    assert c == 0
    assert e == b''
    assert b'Displays configuration' in o.strip()


def test_config():
    c, o, e = _c(['riak-mesos', 'config', '--json', '--config',
                  './config/config.example.json'])
    js = json.loads(o.decode("utf-8").strip())
    assert js['riak']['framework-name'] == 'riak'
    assert c == 0
    assert e == b''


def test_framework_config():
    c, o, e = _c(['riak-mesos', 'framework', 'config', '--json', '--config',
                  './config/config.example.json'])
    js = json.loads(o.decode("utf-8").strip())
    assert js['id'] == 'riak'
    assert c == 0
    assert e == b''

@@ -358,24 +358,33 @@
 ', 'config',
+ 'local',
  '--help'%5D)%0A
@@ -443,16 +443,22 @@
 isplays 
+local 
 configur

Fix test_help()