#NEWLINE# def test_default_calendar( self , tmpdir ) : #NEWLINE# #INDENT# calendars = { #NEWLINE# #INDENT# 'foobar' : { #NEWLINE# #INDENT# 'name' : 'foobar' , #NEWLINE# 'path' : str ( calendars ) , #NEWLINE# 'readonly' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# 'home' : { #NEWLINE# #INDENT# 'name' : 'home' , #NEWLINE# 'path' : str ( tmpdir ) , #NEWLINE# #UNINDENT# } , #NEWLINE# 'work' : { #NEWLINE# #INDENT# 'name' : 'work' , #NEWLINE# 'path' : str ( tmpdir ) , #NEWLINE# 'readonly' : True , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# coll = CalendarCollection ( calendars = calendars , locale = aux . locale , dbpath = ':memory:' ) #NEWLINE# assert ( coll . default_calendar_name is None ) #NEWLINE# with pytest . raises ( ValueError ) : #NEWLINE# #INDENT# coll . default_calendar_name = 'work' #NEWLINE# #UNINDENT# assert ( coll . default_calendar_name is None ) #NEWLINE# with pytest . raises ( ValueError ) : #NEWLINE# #INDENT# coll . default_calendar_name = 'unknownstuff' #NEWLINE# #UNINDENT# assert ( coll . default_calendar_name is None ) #NEWLINE# coll . default_calendar_name = 'home' #NEWLINE# assert ( coll . default_calendar_name == 'home' ) #NEWLINE# assert ( coll . writable_names == [ 'home' ] )