#NEWLINE# def test_occurrences_with_specific_include_dates( ) : #NEWLINE# #INDENT# pattern = Recurrence ( rdates = [ datetime ( 2014 , 1 , 1 , 0 , 0 , 0 ) , datetime ( 2014 , 1 , 2 , 0 , 0 , 0 ) ] ) #NEWLINE# occurrences = [ instance for instance in pattern . occurrences ( dtstart = datetime ( 2014 , 1 , 1 , 0 , 0 , 0 ) , dtend = datetime ( 2014 , 1 , 4 , 0 , 0 , 0 ) ) ] #NEWLINE# assert ( occurrences == [ datetime ( 2014 , 1 , 1 , 0 , 0 , 0 ) , datetime ( 2014 , 1 , 2 , 0 , 0 , 0 ) , datetime ( 2014 , 1 , 4 , 0 , 0 , 0 ) ] ) #NEWLINE# assert ( 3 == pattern . count ( dtstart = datetime ( 2014 , 1 , 1 , 0 , 0 , 0 ) , dtend = datetime ( 2014 , 1 , 4 , 0 , 0 , 0 ) ) ) #NEWLINE# all_occurrences = [ instance for instance in pattern . occurrences ( ) ] #NEWLINE# assert ( all_occurrences == [ datetime ( 2014 , 1 , 1 , 0 , 0 , 0 ) , datetime ( 2014 , 1 , 2 , 0 , 0 , 0 ) ] ) #NEWLINE# assert ( 2 == pattern . count ( ) )