candlepin / rho

ssh scanner for your network
GNU General Public License v2.0
32 stars 20 forks source link

Introduce mock data/credentials and data/profiles for testing #33

Closed noahl closed 7 years ago

noahl commented 7 years ago

Let the test suite substitute fake versions of data/credentials and data/profiles for testing. This then lets the tests have much more control over the correct output from rho, so introduce a way to capture stdout and use it to test some commands more thoroughly.

The big hole in the testing is the scan command. The reason is that we can't run actual scans in the test harness, so all we can do is check that it errors when it should. In the future we could check that it is emitting the correct error messages, but that's a separate issue than 33 and this PR is big enough, so I'd like to file a separate issue for it.

Closes #33.