def test_valid_addition_compound_minor():
    n = Note.from_note_string('C4')
    i = Interval.from_interval_string('m14')
    res = n + i
    assert (res.pitch == 'B') and (res.octave == 5) and (res.accidental == 'b')
Ejemplo n.º 2
0
def test_manual_interval_creation_incorrect_interval_combination():
    with pytest.raises(ValueError):
        i = Interval('P', 6)
Ejemplo n.º 3
0
def test_interval_creation_incorrect_interval_type():
    with pytest.raises(ValueError):
        i = Interval.from_interval_string('asd5')
Ejemplo n.º 4
0
def test_manual_interval_creation_incorrect_interval_type():
    with pytest.raises(ValueError):
        i = Interval('asd', 5)
Ejemplo n.º 5
0
def test_manual_interval_creation_incorrect_size_float_value():
    with pytest.raises(TypeError):
        i = Interval('M', 6.5)
Ejemplo n.º 6
0
def test_interval_creation_correct_interval_augmented():
    i = Interval.from_interval_string('aug5')
    assert i.interval_type == 'aug'
Ejemplo n.º 7
0
def test_interval_creation_correct_size():
    i = Interval.from_interval_string('aug5')
    assert i.size == 5
Ejemplo n.º 8
0
def test_interval_creation_incorrect_size_string():
    with pytest.raises(TypeError):
        i = Interval.from_interval_string('Mbutts')
Ejemplo n.º 9
0
def test_manual_interval_creation_incorrect_interval_combination():
    with pytest.raises(ValueError):
        i = Interval.from_interval_string('P6')
def test_fifth_addition_over_octave():
    n = Note.from_note_string('A4')
    i = Interval.from_interval_string('P5')
    res = n + i
    assert (res.pitch == 'E') and (res.octave
                                   == 5) and (res.accidental is None)
Ejemplo n.º 11
0
def test_interval_creation_incorrect_size_float_value():
    with pytest.raises(TypeError):
        i = Interval.from_interval_string('M6.5')
def test_small_addition_over_octave():
    n = Note.from_note_string('B4')
    i = Interval.from_interval_string('m2')
    res = n + i
    assert (res.pitch == 'C') and (res.octave
                                   == 5) and (res.accidental is None)
def test_valid_addition_compound_diminished_octave():
    n = Note.from_note_string('C4')
    i = Interval.from_interval_string('dim8')
    res = n + i
    assert (res.pitch == 'C') and (res.octave == 5) and (res.accidental == 'b')
def test_valid_addition_compound_augmented():
    n = Note.from_note_string('C4')
    i = Interval.from_interval_string('aug13')
    res = n + i
    assert (res.pitch == 'A') and (res.octave == 5) and (res.accidental == '#')
Ejemplo n.º 15
0
def test_interval_creation_correct_interval_minor():
    i = Interval.from_interval_string('m6')
    assert i.interval_type == 'm'
Ejemplo n.º 16
0
def test_simple_interval_string():
    i = Interval('M', 7)
    assert i.__str__() == 'M7'
Ejemplo n.º 17
0
def test_interval_creation_correct_interval_diminished():
    i = Interval.from_interval_string('dim5')
    assert i.interval_type == 'dim'
Ejemplo n.º 18
0
def test_manual_interval_creation_correct_interval_diminished():
    i = Interval('dim', 5)
    assert i.interval_type == 'dim'
Ejemplo n.º 19
0
def test_interval_creation_correct_size_two_digit():
    i = Interval.from_interval_string('aug15')
    assert i.size == 15
Ejemplo n.º 20
0
def test_manual_interval_creation_correct_interval_augmented():
    i = Interval('aug', 5)
    assert i.interval_type == 'aug'
Ejemplo n.º 21
0
def test_creation_all_valid_intervals_list():
    for x in Interval.VALID_INTERVAL_TYPES:
        i = Interval.from_interval_string(x)
Ejemplo n.º 22
0
def test_manual_interval_creation_correct_interval_perfect():
    i = Interval('P', 5)
    assert i.interval_type == 'P'
Ejemplo n.º 23
0
def test_manual_interval_creation_incorrect_size_negative():
    with pytest.raises(ValueError):
        i = Interval('M', -5)
Ejemplo n.º 24
0
def test_manual_interval_creation_correct_size_whole_number():
    i = Interval('aug', 5)
    assert i.size == 5
Ejemplo n.º 25
0
def test_manual_interval_creation_incorrect_size_string():
    with pytest.raises(TypeError):
        i = Interval('M', 'butts')
Ejemplo n.º 26
0
def test_manual_interval_creation_correct_size_two_digit():
    i = Interval('aug', 15)
    assert i.size == 15
Ejemplo n.º 27
0
def test_manual_interval_creation_correct_interval_minor():
    i = Interval('m', 6)
    assert i.interval_type == 'm'
Ejemplo n.º 28
0
def test_manual_interval_creation_correct_size_as_string():
    i = Interval('aug', '7')
    assert i.size == 7
Ejemplo n.º 29
0
def test_interval_creation_incorrect_size_negative():
    with pytest.raises(ValueError):
        i = Interval.from_interval_string('M-5')
def test_valid_addition_simple_major_second():
    n = Note.from_note_string('C4')
    i = Interval.from_interval_string('M2')
    res = n + i
    assert (res.pitch == 'D') and (res.octave == 4) and (res.accidental
                                                         == None)