<s> def test_basic_editor ( scratch_tree ) : <EOL> sess = scratch_tree . edit ( '<STR_LIT:/>' ) <EOL> assert sess . id == '<STR_LIT>' <EOL> assert sess . path == '<STR_LIT:/>' <EOL> assert sess . record is not None <EOL> assert sess [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert sess [ '<STR_LIT:title>' ] == '<STR_LIT>' <EOL> assert sess [ '<STR_LIT:body>' ] == '<STR_LIT>' <EOL> sess [ '<STR_LIT:body>' ] = '<STR_LIT>' <EOL> sess . commit ( ) <EOL> assert sess . closed <EOL> with open ( sess . get_fs_path ( ) ) as f : <EOL> assert f . read ( ) . splitlines ( ) == [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> def test_create_alt ( scratch_tree , scratch_pad ) : <EOL> sess = scratch_tree . edit ( '<STR_LIT:/>' , alt = '<STR_LIT>' ) <EOL> assert sess . id == '<STR_LIT>' <EOL> assert sess . path == '<STR_LIT:/>' <EOL> assert sess . record is not None <EOL> assert sess [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert sess [ '<STR_LIT:title>' ] == '<STR_LIT>' <EOL> assert sess [ '<STR_LIT:body>' ] == '<STR_LIT>' <EOL> sess [ '<STR_LIT:body>' ] = '<STR_LIT>' <EOL> sess . commit ( ) <EOL> assert sess . closed <EOL> with open ( sess . get_fs_path ( alt = '<STR_LIT>' ) ) as f : <EOL> assert f . read ( ) . splitlines ( ) == [ <EOL> '<STR_LIT>' <EOL> ] <EOL> scratch_pad . cache . flush ( ) <EOL> item = scratch_pad . get ( '<STR_LIT:/>' , alt = '<STR_LIT>' ) <EOL> assert item [ '<STR_LIT>' ] == '<STR_LIT>' <EOL> assert item [ '<STR_LIT:title>' ] == '<STR_LIT>' <EOL> assert item [ '<STR_LIT:body>' ] . source == '<STR_LIT>' <EOL> assert item [ '<STR_LIT>' ] == '<STR_LIT>' </s>
