Deduplication of test code
Adds testAddFileFromStream