This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inlineCallbacks | |
def do_something(): | |
data = yield get(url) | |
if 'some val' in data.content: | |
data = yield get(another_url) | |
defer.returnValue(data) | |
# Is this the equivalent way of describing this with regular callbacks? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Client(object): | |
@inlineCallbacks | |
def login(self): | |
login = yield get('/login/') | |
self.token = login['token'] | |
@inlineCallbacks | |
def poll_work(self): | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__________________________ test_group_info_no_members __________________________ | |
client = <tests.utils.FlaskTestClient object at 0x7f86d03100d0> | |
stripe_invoice = <Mock name='stripe_invoice' spec='Invoice' id='140216995219792'> | |
def test_group_info_no_members(client, stripe_invoice): | |
"""Can query a single group to see its info.""" | |
group = GroupFactory() | |
url = URL + '/{}/info'.format(group.id) | |
rv = client.get(url) | |
with open('/tmp/out.txt', 'wa') as f: | |
f.write(rv.data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.fixture(scope='session') | |
def db(app, request): | |
_db.create_all() | |
def teardown(): | |
_db.session.remove() | |
_db.drop_all() | |
request.addfinalizer(teardown) | |
return _db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ansible-playbook -i hosts -v git_test.yml | |
PLAY [127.0.0.1] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [127.0.0.1] | |
TASK: [Clone the ansible canonical repo into /tmp/ansible_clone] ************** | |
changed: [127.0.0.1] => {"after": "e34cde6bef26309919eb4da21c58a38b61770577", "before": null, "changed": true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Set the hostname in rc.conf | |
lineinfile: dest=/etc/rc.conf regexp="^hostname" line='hostname="{{ hostname }}"' | |
register: hostname | |
- name: Set the hostname | |
shell: hostname {{ hostname }} | |
when: hostname.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "plugins/provisioners/fabric/plugin.rb" | |
Vagrant.configure("2") do |config| | |
*snip* | |
config.vm.provision :fabric do |fab| | |
fab.tasks = ["setup_salt:kwarg=value"] | |
end | |
end |
NewerOlder