def test_chord_degree_name(self): F = ChordGtr(fingering=[0, 3, 2, 0, 1, 0], root="C") F.customtuning(['E', 'A', 'D', 'G', 'B', 'E']) F.pathname('img/chord_degree_name.svg') F.set_color(perfectfourth='rgb(0, 0, 0)', root='rgb(0, 0, 0)') F.draw() with open(path + 'chord_degree_name.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
def test_chord_name_background(self): F = ChordGtr(fingering=[0, 3, 2, 0, 1, 0], root="C") F.customtuning(['F', 'A', 'D', 'G', 'B', 'E']) F.pathname('img/chord_name_background.svg') F.theme(show_note_name=True, background_color='rgb(70,70,70)') F.draw() with open(path + 'chord_name_background.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
def test_fill_fretboard(self): F = ChordGtr(fingering=[0, 3, 2, 0, 1, 0], root="C") F.customtuning(['E', 'A', 'D', 'G', 'B', 'E']) F.pathname(path + "fill_with_chords.svg") F.emptybox() F.fillfretboard() """ F.dwg.save() """ with open(path + 'fill_with_chords.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
def test_lefthandchord(self): F = ChordGtr(fingering=[3, 3, 2, 0, 1, 0], root="C", lefthand=True) F.customtuning(['F', 'A', 'D', 'G', 'B', 'E']) F.pathname('img/lefthandchord.svg') F.draw() with open(path + 'lefthandchord.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
F.pathname('img/TestScaleNameEnhar.svg') F.theme(show_note_name=True) F.draw() F.save() F = ScaleGtr(scale=['D#', 'F', 'G', 'G#', 'A#', 'C', 'D'], root='D#', enharmonic=True) F.customtuning(['D', 'A', 'D', 'G', 'B', 'E']) F.theme(last_fret=24) F.pathname('img/TestScaleNameEnhar24.svg') F.theme(show_note_name=True) F.draw() F.save() F = ChordGtr(fingering=[0, 3, 2, 0, 1, 0], root="C") F.customtuning(['E', 'A', 'D', 'G', 'B', 'E']) F.pathname('img/chord_degree_name.svg') F.set_color(perfectfourth='rgb(0, 0, 0)', root='rgb(0, 0, 0)') F.draw() F.save() F = ScaleGtr(ChordFromName(root='C', quality='M')) F.customtuning(['D', 'A', 'D', 'G', 'A', 'D']) F.pathname('img/TestChordName.svg') F.draw() F.save() F = ChordGtr(fingering=[3, 3, 2, 0, 1, 0], root="C", lefthand=True) F.customtuning(['F', 'A', 'D', 'G', 'B', 'E']) F.pathname('img/lefthandchord.svg')
def test_backgroundfill(self): F = ChordGtr(fingering=[0, 3, 2, 0, 1, 0], root="C") F.customtuning(['E', 'A', 'D', 'G', 'B', 'E']) F.background_color = 'rgb(0,0,0)' F.pathname(path + "background.svg") F.emptybox() F.background_fill() """ F.dwg.save() """ with open(path + 'background.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])
def test_fingering(self): F = ChordGtr() F.setfingering(fingering=[0, 3, 2, 0, 1, 0]) self.assertEqual(F.fingering, [0, 3, 2, 0, 1, 0])
def test_draw(self): F = ChordGtr(fingering=[0, 3, 2, 0, 1, 0], root="C") F.customtuning(['E', 'A', 'D', 'G', 'B', 'E']) F.theme(show_note_name=True) F.theme(open_color_scale=True, string_size=3, default_theme=True) F.pathname(path + "draw.svg") F.draw() """ F.dwg.save() """ with open(path + 'draw.svg', 'r') as f: file = f.read() self.assertEqual( F.dwg.tostring(), file.split('<?xml version="1.0" encoding="utf-8" ?>\n')[1])