<s> from odmtools . odmdata import * <EOL> from odmtools . odmservices import SeriesService , EditService <EOL> from tests import test_util <EOL> class TestSeriesService : <EOL> def setup ( self ) : <EOL> self . connection_string = "<STR_LIT>" <EOL> self . series_service = SeriesService ( connection_string = self . connection_string , debug = False ) <EOL> engine = self . series_service . _session_factory . engine <EOL> test_util . build_db ( engine ) <EOL> self . memory_database = MemoryDatabase ( ) <EOL> self . memory_database . set_series_service ( self . series_service ) <EOL> self . session = self . memory_database . series_service . _session_factory . get_session ( ) <EOL> self . series = test_util . add_series_bulk_data ( self . session ) <EOL> self . edit_service = EditService ( <NUM_LIT:1> , connection = self . memory_database ) <EOL> def test_save_series ( self ) : <EOL> assert self . edit_service . save ( ) <EOL> def test_save_as_series ( self ) : <EOL> var = test_util . add_variable ( self . session ) <EOL> print var <EOL> assert self . edit_service . save_as ( var = var ) <EOL> def test_save_as_existing_series ( self ) : <EOL> var = test_util . add_variable ( self . session ) <EOL> assert self . edit_service . save_existing ( var = var ) </s>
