Skip to content

Commit b1b4147

Browse files
Merge pull request #8 from ankurg22/patch-1
Added py3 support
2 parents 32b9cfd + 9683eef commit b1b4147

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ exports = module.exports = {
2929
CPU_SHARE: "0.8",
3030
MEM_LIMIT: '200m'
3131
},
32+
'py3': {
33+
SOURCE_FILE: 'script.py',
34+
CPU_SHARE: "0.8",
35+
MEM_LIMIT: '200m'
36+
},
3237
'nodejs6': {
3338
SOURCE_FILE: 'script.js',
3439
CPU_SHARE: "0.8",

test/run.py3.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {execRun} from '../src/tasks/run'
2+
import {expect} from 'chai'
3+
4+
5+
describe('run - py3', () => {
6+
it('.py file runs correctly (Python 3.0)', () => {
7+
execRun({
8+
id: 26,
9+
lang: 'py3',
10+
source: (new Buffer(`
11+
inp = input()
12+
print("Hello " + inp)
13+
`)).toString('base64'),
14+
stdin: (new Buffer('World')).toString('base64')
15+
}, (runResult) => {
16+
expect(new Buffer(runResult.stdout, 'base64').toString('ascii')).to.eq('Hello World\n')
17+
})
18+
})
19+
})

0 commit comments

Comments
 (0)