MCPcopy Create free account
hub / github.com/bspaans/python-mingus / scaleTest

Method scaleTest

tests/unit/core/test_scales.py:10–61  ·  view source on GitHub ↗
(self, answer_dict, scale, name)

Source from the content-addressed store, hash-verified

8
9class test_scales(unittest.TestCase):
10 def scaleTest(self, answer_dict, scale, name):
11 for k in answer_dict:
12 if name == "diatonic scale":
13 self.assertEqual(
14 answer_dict[k][0],
15 scale(k[0], k[1]).ascending(),
16 (
17 "The ascending %s of %s, with semitones in %s, "
18 "is not %s; expecting %s"
19 % (
20 name,
21 k[0],
22 k[1],
23 scale(k[0], k[1]).ascending(),
24 answer_dict[k][0],
25 )
26 ),
27 )
28 self.assertEqual(
29 answer_dict[k][1],
30 scale(k[0], k[1]).descending(),
31 (
32 "The descending %s of %s, with semitones in %s, "
33 "is not %s; expecting %s"
34 % (
35 name,
36 k[0],
37 k[1],
38 scale(k[0], k[1]).descending(),
39 answer_dict[k][1],
40 )
41 ),
42 )
43 else:
44 self.assertEqual(
45 answer_dict[k][0],
46 scale(k).ascending(),
47 (
48 "The ascending %s of %s is not %s; "
49 "expecting %s"
50 % (name, k, scale(k).ascending(), answer_dict[k][0])
51 ),
52 )
53 self.assertEqual(
54 answer_dict[k][1],
55 scale(k).descending(),
56 (
57 "The descending %s of %s is not %s; "
58 "expecting %s"
59 % (name, k, scale(k).descending(), answer_dict[k][1])
60 ),
61 )
62
63 def test_diatonic(self):
64 self.scaleTest(

Callers 15

test_diatonicMethod · 0.95
test_ionianMethod · 0.95
test_dorianMethod · 0.95
test_phrygianMethod · 0.95
test_lydianMethod · 0.95
test_mixolydianMethod · 0.95
test_aeolianMethod · 0.95
test_locrianMethod · 0.95
test_majorMethod · 0.95
test_harmonic_majorMethod · 0.95
test_natural_minorMethod · 0.95
test_harmonic_minorMethod · 0.95

Calls 2

ascendingMethod · 0.45
descendingMethod · 0.45

Tested by

no test coverage detected