Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
# Add field | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
# { | |
# "hello": "world", | |
# "foo": "bar" | |
# } | |
# Override field value | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
{ |
@contextlib.contextmanager | |
def multiple_targets(mock_patches): | |
""" | |
`mock_patches` is a list (or iterable) of mock.patch objects | |
Example usage: | |
with mock.patch.multiple_targets([ | |
mock.patch('os.path.exists', side_effect=mock_path_exists), | |
mock.patch('subprocess.Popen'), |
""" | |
Test (data) migrations in Django. | |
This uses py.test/pytest-django (the `transactional_db` fixture comes from there), | |
but could be easily adopted for Django's testrunner: | |
from django.test.testcases import TransactionTestCase | |
class FooTestcase(TransactionTestCase): | |
def test_with_django(self): |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
__all__ = ( | |
####### Class Objects | |
#CoGetClassObject - Normal, not wrapped | |
'CoDllGetClassObject', #Get ClassObject from a DLL file | |
####### ClassFactory::CreateInstance Wrappers | |
'CoCreateInstanceFromFactory', #Create an object via IClassFactory::CreateInstance | |
'CoCreateInstanceFromFactoryLicenced', #Create a licenced object via IClassFactory2::CreateInstanceLic |