Skip to content

Commit

Permalink
modify python-app.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
pzy2000 committed Aug 22, 2024
1 parent dce6f18 commit b74d9bd
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions auto_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import os
import pytest
from main import load_blacklist, save_blacklist, blacklist

blacklist = set()


def load_blacklist():
global blacklist
blacklist.clear()
if os.path.exists("blacklist.txt"):
with open("blacklist.txt", "r") as file:
for line in file:
blacklist.add(line.strip())


def save_blacklist():
global blacklist
with open("blacklist.txt", "w") as file:
for item in blacklist:
file.write(f"{item}\n")


def test_load_blacklist(tmpdir):
Expand Down Expand Up @@ -63,4 +79,3 @@ def test_remove_from_blacklist():

# Check that the item is not in the blacklist
assert "AppToRemove" not in blacklist

0 comments on commit b74d9bd

Please sign in to comment.