How to use the fasteners.__file__ function in fasteners

To help you get started, we’ve selected a few fasteners examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudify-cosmo / cloudify-manager / tests / testenv / __init__.py View on Github external
# The plugins storage dir is mounted as a writable shared directory
        # between all containers and the host machine. Most mock plugins make
        # use of a utility method in mock_plugins.utils.update_storage to save
        # state that the test can later read.
        resources = [{
            'src': self.plugins_storage_dir,
            'dst': '/opt/integration-plugin-storage',
            'write': True
        }]

        # Import only for the sake of finding the module path on the file
        # system
        import mock_plugins
        import fasteners
        mock_plugins_dir = os.path.dirname(mock_plugins.__file__)
        fasteners_dir = os.path.dirname(fasteners.__file__)

        # All code directories will be mapped to the management worker
        # virtualenv and will also be included in the custom agent package
        # created in the test suite setup
        code_directories = [
            # Plugins import mock_plugins.utils.update_storage all over the
            # place
            mock_plugins_dir,

            # mock_plugins.utils.update_storage makes use of the fasteners
            # library
            fasteners_dir
        ]

        # All plugins under mock_plugins are mapped. These are mostly used
        # as operations and workflows mapped in the different tests blueprints.
github cloudify-cosmo / cloudify-manager / tests / integration_tests / framework / env.py View on Github external
# between all containers and the host machine. Most mock plugins make
        # use of a utility method in
        # integration_tests_plugins.utils.update_storage to save state that the
        # test can later read.
        resources = [{
            'src': self.plugins_storage_dir,
            'dst': '/opt/integration-plugin-storage',
            'write': True
        }]

        # Import only for the sake of finding the module path on the file
        # system
        import integration_tests_plugins
        import fasteners
        plugins_dir = os.path.dirname(integration_tests_plugins.__file__)
        fasteners_dir = os.path.dirname(fasteners.__file__)

        # All code directories will be mapped to the management worker
        # virtualenv and will also be included in the custom agent package
        # created in the test suite setup
        code_directories = [
            # Plugins import integration_tests_plugins.utils.update_storage
            # all over the place
            plugins_dir,

            # integration_tests_plugins.utils.update_storage makes use of the
            # fasteners library
            fasteners_dir
        ]

        # All plugins under integration_tests_plugins are mapped. These are
        # mostly used as operations and workflows mapped in the different tests