<s> import unittest <EOL> from . util import TrelloElementMock <EOL> from trello_collection import TrelloCollection <EOL> class TrelloCollectionTests ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . collection = TrelloElementMock . collection ( ) <EOL> self . trello_collection = TrelloCollection ( self . collection ) <EOL> def test_it_filters_the_closed_elements ( self ) : <EOL> collection = TrelloElementMock . collection ( ) <EOL> collection [ <NUM_LIT:0> ] . closed = True <EOL> trello_collection = TrelloCollection ( collection ) <EOL> self . assertEqual ( len ( trello_collection . elements ) , len ( collection ) - <NUM_LIT:1> ) <EOL> def test_names_returns_every_name_from_the_collection ( self ) : <EOL> self . assertEqual ( self . trello_collection . names ( ) , [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> def test_find_gets_an_element_from_the_collection_by_index ( self ) : <EOL> self . assertEqual ( self . trello_collection . find ( <NUM_LIT:1> ) , self . collection [ <NUM_LIT:1> ] ) <EOL> def test_on_init_it_gets_the_property_from_the_trello_element ( self ) : <EOL> trello_element = TrelloElementMock ( "<STR_LIT>" ) <EOL> trello_element . collection = TrelloElementMock . collection ( ) <EOL> collection = TrelloCollection ( trello_element , "<STR_LIT>" ) <EOL> self . assertEqual ( collection . elements , trello_element . collection ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
