Updated endian aware patch for test

Original patch used a DIY endian test, it was suggested
that using os.endianness() was a better approach