Skip to content

Commit c14a750

Browse files
committed
fix: python tests
1 parent 29459b6 commit c14a750

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Examples/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Commands.Bash.run("ls /bin/ls").log()
2323
Commands.Ruby.run("require 'base64'; puts Base64.encode64('qiuzhifei')").log()
2424

2525
// Python
26-
Commands.Python.run("import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))").log()
26+
Commands.Python.run("import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))").log()
2727

2828
// Custom
2929
let node = Commands.Alias("node", dashc: "-e")

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ let result = Commands.Task.run("python main.py")
3737
```
3838
Execute python commands.
3939
```swift
40-
let result = Commands.Task.run("python -c import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))")
40+
let result = Commands.Task.run("python -c import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))")
4141
```
4242
Or
4343
```swift
44-
let result = Commands.Python.run("import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))")
44+
let result = Commands.Python.run("import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))")
4545
```
4646

4747
### Ruby

README_cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ let result = Commands.Task.run("python main.py")
3737
```
3838
Execute python commands.
3939
```swift
40-
let result = Commands.Task.run("python -c import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))")
40+
let result = Commands.Task.run("python -c import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))")
4141
```
4242
Or
4343
```swift
44-
let result = Commands.Python.run("import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))")
44+
let result = Commands.Python.run("import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))")
4545
```
4646

4747
### Ruby
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import base64;
2-
print(base64.b64encode('qiuzhifei').decode('ascii'));
2+
print(base64.b64encode(b'qiuzhifei').decode('ascii'));

Tests/CommandsTests/swift_commandsTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class swift_commandsTests: XCTestCase {
3232
func testCommandsPython() throws {
3333
let python = Commands.Python
3434

35-
let base64Result = python.run("import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))")
35+
let base64Result = python.run("import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))")
3636
XCTAssert(base64Result.isSuccess)
3737
XCTAssert(base64Result.output == "qiuzhifei".data(using: .utf8)!.base64EncodedString())
3838
XCTAssert(base64Result.output == "cWl1emhpZmVp")
@@ -90,8 +90,8 @@ final class swift_commandsTests: XCTestCase {
9090

9191
// python
9292
XCTAssertEqual(
93-
Commands.Python.run("import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))"),
94-
Commands.Task.run("python -c import base64; print(base64.b64encode('qiuzhifei').decode('ascii'))")
93+
Commands.Python.run("import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))"),
94+
Commands.Task.run("python -c import base64; print(base64.b64encode(b'qiuzhifei').decode('ascii'))")
9595
)
9696

9797
// node

0 commit comments

Comments
 (0)