Unit tests

Covered tray,py with unit tests.