Skip to content

Commit

Permalink
chdir for tests, test reading mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
bbilly1 committed May 21, 2024
1 parent 200f5ed commit a201d43
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tubearchivist/home/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""test configs"""

import os

import pytest


@pytest.fixture(scope="session", autouse=True)
def change_test_dir(request):
"""change directory to project folder"""
os.chdir(request.config.rootdir / "tubearchivist")
8 changes: 8 additions & 0 deletions tubearchivist/home/tests/test_ta/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from home.src.ta.helper import (
date_parser,
get_duration_str,
get_mapping,
is_shorts,
randomizor,
time_parser,
Expand Down Expand Up @@ -80,6 +81,13 @@ def test_time_parser_with_non_numeric_input():
time_parser(timestamp)


def test_get_mapping():
"""test mappint"""
index_config = get_mapping()
assert isinstance(index_config, list)
assert all(isinstance(i, dict) for i in index_config)


def test_is_shorts():
"""is shorts id"""
youtube_id = "YG3-Pw3rixU"
Expand Down

0 comments on commit a201d43

Please sign in to comment.