Skip to content

jadolg/OfflineSandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Decorator to return a default value for a function when offline

Decorate your functions with a default value and set OfflineSandbox.SANDBOX to your Online/Offline status

import OfflineSandbox

OfflineSandbox.SANDBOX = False


@OfflineSandbox.offline_sandbox_value('mundo')
def greet():
    return 'hola'

print(greet())

OfflineSandbox.SANDBOX = True

print(greet())

You can also respond given the availability of a specific URL

@OfflineSandbox.offline_sandbox_value('mundo', url='https://im-online.herokuapp.com/')
def greet_with_url():
    return 'hola'

print(greet_with_url())

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages