def METHOD_NAME(self):
    # Even though the module has an __file__, use __loader__.module_repr()
    m = ModuleType('foo')
    # Yes, a class not an instance.
    m.__loader__ = FullLoader
    m.__file__ = '/tmp/foo.py'
    self.assertEqual(repr(m), "<module 'foo' (crafted)>")