Exemplo n.º 1
0
def test_build_greengraph(mock_geolocate, mock_location_sequence, mock_get,
                          mock_imread, mock_count_green, mock_show_green,
                          mock_plot, mock_savefig, mock_show):
    args = parser.parse_args([
        '--from', 'London', '--to', 'Paris', '--steps', '1', '--out',
        'file_name'
    ])
    build_greengraph(args)
    mock_location_sequence.assert_called_with((10., 10.), (10., 10.), 1)
    assert mock_count_green.called == True
Exemplo n.º 2
0
def test_build_greengraph_steps(mock_green_between,mock_savefig,mock_plot,mock_show):
    args = parser.parse_args(['--to','London','--from','Amsterdam'])
    build_greengraph(args)
    mock_green_between.assert_called_with(20)
Exemplo n.º 3
0
def test_build_greengraph(mock_geolocate,mock_location_sequence,mock_get,mock_imread,mock_count_green,mock_show_green,mock_plot, mock_savefig,mock_show):
    args = parser.parse_args(['--from','London','--to','Paris','--steps','1','--out','file_name'])
    build_greengraph(args)
    mock_location_sequence.assert_called_with((10.,10.),(10.,10.),1)
    assert mock_count_green.called == True
Exemplo n.º 4
0
def test_build_greengraph_steps(mock_green_between, mock_savefig, mock_plot,
                                mock_show):
    args = parser.parse_args(['--to', 'London', '--from', 'Amsterdam'])
    build_greengraph(args)
    mock_green_between.assert_called_with(20)