<s> from cloudservers . backup_schedules import * <EOL> from fakeserver import FakeServer <EOL> from utils import assert_isinstance <EOL> cs = FakeServer ( ) <EOL> def test_get_backup_schedule ( ) : <EOL> s = cs . servers . get ( <NUM_LIT> ) <EOL> b = cs . backup_schedules . get ( server = s ) <EOL> assert_isinstance ( b , BackupSchedule ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> b = cs . backup_schedules . get ( server = <NUM_LIT> ) <EOL> assert_isinstance ( b , BackupSchedule ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> assert_isinstance ( s . backup_schedule , BackupSchedule ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> b = s . backup_schedule . get ( ) <EOL> cs . assert_called ( '<STR_LIT:GET>' , '<STR_LIT>' ) <EOL> def test_create_update_backup_schedule ( ) : <EOL> s = cs . servers . get ( <NUM_LIT> ) <EOL> cs . backup_schedules . update ( <EOL> server = s , <EOL> enabled = True , <EOL> weekly = BACKUP_WEEKLY_THURSDAY , <EOL> daily = BACKUP_DAILY_H_1000_1200 <EOL> ) <EOL> cs . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' ) <EOL> s . backup_schedule . update ( enabled = False ) <EOL> cs . assert_called ( '<STR_LIT:POST>' , '<STR_LIT>' ) <EOL> def test_delete_backup_schedule ( ) : <EOL> s = cs . servers . get ( <NUM_LIT> ) <EOL> cs . backup_schedules . delete ( s ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> cs . backup_schedules . delete ( <NUM_LIT> ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> s . backup_schedule . delete ( ) <EOL> cs . assert_called ( '<STR_LIT>' , '<STR_LIT>' ) </s>
