notes.py (829B) - raw
1 import os 2 3 import pytest 4 5 from boxnotes2html.boxnote import AttributeChunk, BoxNote 6 7 here = os.path.dirname(__file__) 8 simple_note_path = "simple_note.boxnote" 9 complex_note_path = "complex_note.boxnote" 10 11 12 @pytest.fixture 13 def simple_note_fullpath(): 14 return os.path.join(here, simple_note_path) 15 16 17 @pytest.fixture 18 def simple_note(): 19 ''' 20 A basic note to test loading/unloading/parsing 21 ''' 22 with open(os.path.join(here, simple_note_path)) as f: 23 return BoxNote(f.read()) 24 25 26 @pytest.fixture 27 def complex_note(): 28 ''' 29 A more complex, contrived note that has every possible data structure I can think of 30 in boxnotes 31 ''' 32 with open(os.path.join(here, complex_note_path)) as f: 33 return BoxNote(f.read()) 34 35 36 @pytest.fixture() 37 def simple_attribute(): 38 return AttributeChunk("*1*4*10+2|1+1")