Skip to content

Commit 8afcd0c

Browse files
authored
chore: linting (microsoft#35)
1 parent a61e1ed commit 8afcd0c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ env/
1111
htmlcov/
1212
.coverage
1313
.DS_Store
14+
.vscode/

tests/test_input.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
# limitations under the License.
1414

1515
import asyncio
16-
from os import path
1716
import os
1817

1918
from playwright.page import Page
2019

21-
FILE_TO_UPLOAD = path.join(
20+
FILE_TO_UPLOAD = os.path.join(
2221
os.path.dirname(os.path.realpath(__file__)), "assets/file-to-upload.txt"
2322
)
2423

@@ -27,7 +26,7 @@
2726

2827
async def test_should_upload_the_file(page, server):
2928
await page.goto(server.PREFIX + "/input/fileupload.html")
30-
file_path = path.relpath(FILE_TO_UPLOAD, os.getcwd())
29+
file_path = os.path.relpath(FILE_TO_UPLOAD, os.getcwd())
3130
input = await page.querySelector("input")
3231
await input.setInputFiles(file_path)
3332
assert await page.evaluate("e => e.files[0].name", input) == "file-to-upload.txt"
@@ -47,7 +46,9 @@ async def test_should_upload_the_file(page, server):
4746

4847
async def test_should_work(page):
4948
await page.setContent("<input type=file>")
50-
await page.setInputFiles("input", path.join(__dirname, "assets/file-to-upload.txt"))
49+
await page.setInputFiles(
50+
"input", os.path.join(__dirname, "assets/file-to-upload.txt")
51+
)
5152
assert await page.evalOnSelector("input", "input => input.files.length") == 1
5253
assert (
5354
await page.evalOnSelector("input", "input => input.files[0].name")
@@ -199,8 +200,8 @@ async def test_should_not_accept_multiple_files_for_single_file_input(page, serv
199200
try:
200201
await file_chooser.setFiles(
201202
[
202-
path.relative(__dirname + "assets/file-to-upload.txt"),
203-
path.relative(__dirname + "assets/pptr.png"),
203+
os.path.realpath(os.path.join(__dirname, "assets/file-to-upload.txt")),
204+
os.path.realpath(os.path.join(__dirname, "assets/pptr.png")),
204205
]
205206
)
206207
except Exception as exc:

0 commit comments

Comments
 (0)