Ejemplo n.º 1
0
def test_if_all_needed_correct_output_center_mass(qtbot, capsys):
    setup_tests(qtbot)
    logger.check_if_all_needed(Flags.center_mass, display=False)
    capture = capsys.readouterr()
    string_out = capture.out
    assert "The circular centre must be calculated" \
        and "The aperture must be calculated" in string_out
Ejemplo n.º 2
0
def test_if_all_needed_correct_output_ransac_fit(qtbot, capsys):
    setup_tests(qtbot)
    logger.check_if_all_needed(Flags.ransac_fit, display=False)
    capture = capsys.readouterr()
    string_out = capture.out
    assert "The Virtual Annular Dark Field must be initialised" \
        and "The center of mass must be calculated"\
        and "The aperture must be calculated" in string_out
def test_load_npz(qtbot):
    aw = setup_tests(qtbot)

    aw.npz_path = "/home/ubuntu/example-data/VirtualAnnularImages_20200305_185503.npz"
    aw._ui.action_npz.trigger()

    assert logger.check_if_all_needed(Flags.npz_loaded)
def test_load_files(qtbot):
    aw = setup_tests(qtbot)
    assert logger.check_if_all_needed(Flags.files_loaded)
Ejemplo n.º 5
0
def test_if_all_needed_prerequisite(qtbot):
    setup_tests(qtbot)
    enter()
    assert logger.check_if_all_needed(Flags.center_mass) == False
Ejemplo n.º 6
0
def test_if_all_needed_flag_type(qtbot):
    setup_tests(qtbot)
    with pytest.raises(AttributeError) as excinfo:
        logger.check_if_all_needed(Flags.wrongtype)
        assert "wrong type" in str(excinfo.value)
Ejemplo n.º 7
0
def test_if_all_needed_correct_output_init_vadf(qtbot, capsys):
    setup_tests(qtbot)
    logger.check_if_all_needed(Flags.vadf_init, display=False)
    capture = capsys.readouterr()
    string_out = capture.out
    assert "The Virtual Annular Dark Field must be initialised" in string_out