Skip to content

Commit

Permalink
Merge pull request NixOS#56217 from aanderse/beanstalk
Browse files Browse the repository at this point in the history
nixos/beanstalkd: update test to use python3 instead of python2
  • Loading branch information
flokli committed Feb 23, 2019
2 parents ce019e7 + c5ddcfe commit bea06ac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nixos/tests/beanstalkd.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import ./make-test.nix ({ pkgs, lib, ... }:

let
pythonEnv = pkgs.python3.withPackages (p: [p.beanstalkc]);

produce = pkgs.writeScript "produce.py" ''
#!${pkgs.python2.withPackages (p: [p.beanstalkc])}/bin/python
#!${pythonEnv.interpreter}
import beanstalkc
queue = beanstalkc.Connection(host='localhost', port=11300, parse_yaml=False);
queue.put('this is a job')
queue.put('this is another job')
queue.put(b'this is a job')
queue.put(b'this is another job')
'';

consume = pkgs.writeScript "consume.py" ''
#!${pkgs.python2.withPackages (p: [p.beanstalkc])}/bin/python
#!${pythonEnv.interpreter}
import beanstalkc
queue = beanstalkc.Connection(host='localhost', port=11300, parse_yaml=False);
job = queue.reserve(timeout=0)
print job.body
print(job.body.decode('utf-8'))
job.delete()
'';

Expand Down

0 comments on commit bea06ac

Please sign in to comment.