Esempio n. 1
0
def test_command_args():
    args = parser.parse_args([
        '--from', 'London', '--to', 'Paris', '--steps', '15', '--out',
        'file_name'
    ])
    assert args.startLoc == 'London'
    assert args.endLoc == 'Paris'
    assert args.steps == 15
    assert args.out == 'file_name'
Esempio n. 2
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
Esempio n. 3
0
def test_command_args():
    args = parser.parse_args(['--from','London','--to','Paris','--steps','15','--out','file_name'])
    assert args.startLoc == 'London'
    assert args.endLoc == 'Paris'
    assert args.steps == 15
    assert args.out == 'file_name'
Esempio 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)
Esempio n. 5
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
Esempio n. 6
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)