BuildSlave: add some unit tests for 'attached'

These are some tests in prep for some other patches I'll post soon. However, this commit works well on its own so I figured it could go first.