Adding test coverage for pipelines
Fixing a bug in the tests