-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved data files to pytest fixtures.
Datafiles now load from relative path. Fixes: #27
- Loading branch information
Showing
11 changed files
with
107 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,37 @@ | ||
import os | ||
import sys | ||
|
||
import pytest | ||
|
||
sys.path.append(os.path.join(os.path.dirname(__file__), "helpers")) | ||
|
||
|
||
def load_data(datafile): | ||
"""Load test data from a fixture datafile""" | ||
with open(os.path.join(os.path.dirname(__file__), "fixtures", datafile)) as fp: | ||
return fp.read() | ||
|
||
|
||
@pytest.fixture | ||
def data_mastodon_json(): | ||
return load_data("data-mastodon.json") | ||
|
||
|
||
@pytest.fixture | ||
def data_rapidblock_json(): | ||
return load_data("data-rapidblock.json") | ||
|
||
|
||
@pytest.fixture | ||
def data_suspends_01(): | ||
return load_data("data-suspends-01.csv") | ||
|
||
|
||
@pytest.fixture | ||
def data_silences_01(): | ||
return load_data("data-silences-01.csv") | ||
|
||
|
||
@pytest.fixture | ||
def data_noop_01(): | ||
return load_data("data-noop-01.csv") |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters