Exemplo n.º 1
0
def test_main_without_argv_and_success(version, mocked_sys):
    mocked_sys.argv = ['profit', '--version']

    result = command.main()

    assert 0 == result
    mocked_sys.stdout.write.assert_called_once_with(version + '\n')
Exemplo n.º 2
0
def test_get_sources(mocked_sys):

    result = command.main(['profit', 'get-sources'])

    assert 0 == result
    assert False == mocked_sys.stdout.write.called
Exemplo n.º 3
0
def test_main_with_no_args(mocked_sys):

    result = command.main([])

    assert 1 == result
    mocked_sys.stdout.write.assert_called_once_with('Invalid command: \n')