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')
Пример #2
0
def test_manual_interval_creation_incorrect_interval_combination():
    with pytest.raises(ValueError):
        i = Interval('P', 6)
Пример #3
0
def test_interval_creation_incorrect_interval_type():
    with pytest.raises(ValueError):
        i = Interval.from_interval_string('asd5')
Пример #4
0
def test_manual_interval_creation_incorrect_interval_type():
    with pytest.raises(ValueError):
        i = Interval('asd', 5)
Пример #5
0
def test_manual_interval_creation_incorrect_size_float_value():
    with pytest.raises(TypeError):
        i = Interval('M', 6.5)
Пример #6
0
def test_interval_creation_correct_interval_augmented():
    i = Interval.from_interval_string('aug5')
    assert i.interval_type == 'aug'
Пример #7
0
def test_interval_creation_correct_size():
    i = Interval.from_interval_string('aug5')
    assert i.size == 5
Пример #8
0
def test_interval_creation_incorrect_size_string():
    with pytest.raises(TypeError):
        i = Interval.from_interval_string('Mbutts')
Пример #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)
Пример #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 == '#')
Пример #15
0
def test_interval_creation_correct_interval_minor():
    i = Interval.from_interval_string('m6')
    assert i.interval_type == 'm'
Пример #16
0
def test_simple_interval_string():
    i = Interval('M', 7)
    assert i.__str__() == 'M7'
Пример #17
0
def test_interval_creation_correct_interval_diminished():
    i = Interval.from_interval_string('dim5')
    assert i.interval_type == 'dim'
Пример #18
0
def test_manual_interval_creation_correct_interval_diminished():
    i = Interval('dim', 5)
    assert i.interval_type == 'dim'
Пример #19
0
def test_interval_creation_correct_size_two_digit():
    i = Interval.from_interval_string('aug15')
    assert i.size == 15
Пример #20
0
def test_manual_interval_creation_correct_interval_augmented():
    i = Interval('aug', 5)
    assert i.interval_type == 'aug'
Пример #21
0
def test_creation_all_valid_intervals_list():
    for x in Interval.VALID_INTERVAL_TYPES:
        i = Interval.from_interval_string(x)
Пример #22
0
def test_manual_interval_creation_correct_interval_perfect():
    i = Interval('P', 5)
    assert i.interval_type == 'P'
Пример #23
0
def test_manual_interval_creation_incorrect_size_negative():
    with pytest.raises(ValueError):
        i = Interval('M', -5)
Пример #24
0
def test_manual_interval_creation_correct_size_whole_number():
    i = Interval('aug', 5)
    assert i.size == 5
Пример #25
0
def test_manual_interval_creation_incorrect_size_string():
    with pytest.raises(TypeError):
        i = Interval('M', 'butts')
Пример #26
0
def test_manual_interval_creation_correct_size_two_digit():
    i = Interval('aug', 15)
    assert i.size == 15
Пример #27
0
def test_manual_interval_creation_correct_interval_minor():
    i = Interval('m', 6)
    assert i.interval_type == 'm'
Пример #28
0
def test_manual_interval_creation_correct_size_as_string():
    i = Interval('aug', '7')
    assert i.size == 7
Пример #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)