def test_import_only_ends_with_interface(self):
        path = os.path.dirname(interfaces.__file__)
        with open(os.path.join(path, 'del_me.py'), 'w+') as f:
            print('from nose.tools import ok_', file=f)
            print('ok_(False)', file=f)
            f.flush()
        reload(interfaces)
        ok_('interfaces.del_me' not in sys.modules)
        try:
            os.remove(os.path.join(path, 'del_me.py'))
            os.remove(os.path.join(path, 'del_me.pyc'))
        except OSError:
            pass

        create_dummy_interface(file_name='del_me_interface.py')
        loaded = False
        try:
            reload(interfaces)
        except ValueError:
            loaded = True
        os.remove(os.path.join(path, 'del_me_interface.py'))
        os.remove(os.path.join(path, 'del_me_interface.pyc'))
        if 'del_me_interface' in sys.modules:
            loaded = True
        ok_(loaded)
dataset/ETHPy150Open KavenC/Linot/tests/interfaces/test_interfaces.py/TestIntrefaces.test_import_only_ends_with_interface/original