Added test for valid hostname method

Fails if 'data' key not there

Convert to raw string