Esempio n. 1
0
def test_multiple_edges():
    edges = get_edges_near_energy(640, width=100)
    assert len(edges) == 12
    assert edges == [
        'Mn_L3', 'I_M4', 'Cd_M2', 'Mn_L2', 'V_L1', 'I_M5', 'Cd_M3', 'In_M3',
        'Xe_M5', 'Ag_M2', 'F_K', 'Xe_M4'
    ]
Esempio n. 2
0
def test_multiple_edges_descending():
    edges = get_edges_near_energy(640, width=100, order='descending')
    assert len(edges) == 12
    assert edges == [
        'F_K', 'Xe_M4', 'Xe_M5', 'In_M3', 'Cd_M2', 'Mn_L2', 'Mn_L3', 'I_M4',
        'V_L1', 'I_M5', 'Cd_M3', 'Ag_M2'
    ]
Esempio n. 3
0
def test_wrong_ordering():
    with pytest.raises(ValueError):
        get_edges_near_energy(532, order='random')
Esempio n. 4
0
def test_negative_energy_width():
    with pytest.raises(Exception):
        get_edges_near_energy(849, width=-5)
Esempio n. 5
0
def test_single_edge():
    edges = get_edges_near_energy(532, width=0)
    assert len(edges) == 1
    assert edges == ['O_K']