def test_not_a_number_gauge_input(self):
     pitch = ScientificPitch('e', 4)
     length = Length(25.5)
     string = GuitarString(.012, 'DAPL')
     tension = float("{0:.2f}".format(
         calculate_tension(length, pitch, string)))
     self.assertEqual(23.33, tension)
 def test_gauge_greater_than_min(self):
     self.assertEqual(GuitarString.convert_to_unit_weight(.100, 'CKPLG'), 0.0008344310000000007)
 def test_gauge_matches(self):
     self.assertEqual(GuitarString.convert_to_unit_weight(.008, 'CKPLG'), .000014240)
 def test_gauge_less_than_min(self):
     self.assertEqual(GuitarString.convert_to_unit_weight(.007, 'CKPLG'), 1.0233999999999999e-05)
 def test_valid_string_material_input(self):
     self.assertEqual(True, GuitarString.is_valid_string_material('CKPLG'))
Esempio n. 6
0
def get_tension(tension_input):
    length = Length(tension_input['scale_length'], tension_input['total_strings'], tension_input['string_number'])
    pitch = ScientificPitch(tension_input['note'], tension_input['octave'])
    string = GuitarString(tension_input['gauge'], tension_input['string_type'])
    tension = calculate_tension(length, pitch, string)
    return round_tension(tension)
 def test_gauge_greater_than_min(self):
     self.assertEqual(GuitarString.convert_to_unit_weight(.100, 'CKPLG'),
                      0.0008344310000000007)
 def test_gauge_matches(self):
     self.assertEqual(GuitarString.convert_to_unit_weight(.008, 'CKPLG'),
                      .000014240)
 def test_gauge_less_than_min(self):
     self.assertEqual(GuitarString.convert_to_unit_weight(.007, 'CKPLG'),
                      1.0233999999999999e-05)
Esempio n. 10
0
 def test_valid_material_init(self):
     guitar_string = GuitarString(.101, 'CKPLG')
     self.assertEqual(guitar_string.string_material, 'CKPLG')
Esempio n. 11
0
 def test_valid_gauge_init(self):
     guitar_string = GuitarString(.001, 'CKPLG')
     self.assertEqual(guitar_string.gauge, .001)
Esempio n. 12
0
 def test_valid_string_material_input(self):
     self.assertEqual(True, GuitarString.is_valid_string_material('CKPLG'))