Skip to content

Commit

Permalink
Clean organic data before running integ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rushabhvaria committed Mar 30, 2023
1 parent f9fecd6 commit 4a72e82
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ package_test:
./package_test/run.sh

integration_tests:
@echo cleaning organic data...
python -m pytest ./integration_tests/clean_organic_data.py
@echo integration tests...
python -m pytest --cov ./pinterest/ --cov-branch ./integration_tests/ --cov-report term-missing
python -m pytest --ignore=clean_organic_data.py --cov ./pinterest/ --cov-branch ./integration_tests/ --cov-report term-missing

clean: clean-build clean-pyc ## Clean

Expand Down
18 changes: 18 additions & 0 deletions integration_tests/clean_organic_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Delete all non-essential organic data from test user
"""

from pinterest.organic.boards import Board
from integration_tests.config import DEFAULT_BOARD_ID

def test_delete_organic_data():
"""
Delete organic boards from default client
"""
all_boards, _ = Board.get_all()
for board in all_boards:
if board.id == DEFAULT_BOARD_ID:
continue
Board.delete(board_id=board.id)

assert len(Board.get_all()[0]) == 1

0 comments on commit 4a72e82

Please sign in to comment.