(PUP-751) Ensure resource knows it's type

By looking up the definition first, many tests were broken because of
expectations about filesystem access. By ensuring that the resources
are created with the expected resource_type there isn't any lookup
neccessary.