Skip to content

Commit f84396b

Browse files
committed
Use downloads_folder fixture
1 parent 39d27b1 commit f84396b

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

tests/downloads/test_add_zip_type.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def test_case():
1616

1717

1818
ZIP_URL = "https://github.com/microsoft/api-guidelines"
19-
ANGLE_BRACKET_SVG_PATH = "m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"
2019

2120

2221
@pytest.fixture()

tests/password_manager/test_password_csv_correctness.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import csv
22
import os
33
import re
4-
import sys
54
import time
6-
from os import environ
75

86
import pytest
97
from pynput.keyboard import Controller, Key
@@ -16,11 +14,10 @@ def test_case():
1614
return "2241522"
1715

1816

19-
MAC_GHA = environ.get("GITHUB_ACTIONS") == "true" and sys.platform.startswith("darwin")
20-
21-
2217
@pytest.mark.headed
23-
def test_password_csv_correctness(driver_and_saved_logins, home_folder, sys_platform):
18+
def test_password_csv_correctness(
19+
driver_and_saved_logins, downloads_folder, sys_platform
20+
):
2421
"""
2522
C2241522: Verify than an exported password.csv file displays the correct information
2623
"""
@@ -43,8 +40,7 @@ def test_password_csv_correctness(driver_and_saved_logins, home_folder, sys_plat
4340
keyboard.tap(Key.enter)
4441

4542
# Verify the exported csv file is present in the target folder
46-
downloads_directory = about_logins.get_downloads_dir()
47-
csv_file = os.path.join(downloads_directory, "passwords.csv")
43+
csv_file = os.path.join(downloads_folder, "passwords.csv")
4844
about_logins.wait.until(lambda _: os.path.exists(csv_file))
4945

5046
# Verify the contents of the exported csv file

tests/password_manager/test_password_csv_export.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import os
2-
import sys
32
import time
4-
from os import environ
53

64
import pytest
75
from pynput.keyboard import Controller, Key
@@ -14,12 +12,9 @@ def test_case():
1412
return "2241521"
1513

1614

17-
MAC_GHA = environ.get("GITHUB_ACTIONS") == "true" and sys.platform.startswith("darwin")
18-
19-
2015
@pytest.mark.headed
2116
def test_password_csv_export(
22-
driver_and_saved_logins, home_folder, sys_platform, opt_ci
17+
driver_and_saved_logins, downloads_folder, sys_platform, opt_ci
2318
):
2419
"""
2520
C2241521: Verify that a password.csv file can be exported from about:logins
@@ -43,8 +38,7 @@ def test_password_csv_export(
4338
keyboard.tap(Key.enter)
4439

4540
# Verify the exported csv file is present in the target folder
46-
downloads_directory = about_logins.get_downloads_dir()
47-
csv_file = os.path.join(downloads_directory, "passwords.csv")
41+
csv_file = os.path.join(downloads_folder, "passwords.csv")
4842
about_logins.wait.until(lambda _: os.path.exists(csv_file))
4943

5044
# Delete the password.csv created

0 commit comments

Comments
 (0)