chdir for tests, test reading mapping
This commit is contained in:
parent
200f5ed5a2
commit
a201d43bfd
|
@ -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")
|
|
@ -4,6 +4,7 @@ import pytest
|
|||
from home.src.ta.helper import (
|
||||
date_parser,
|
||||
get_duration_str,
|
||||
get_mapping,
|
||||
is_shorts,
|
||||
randomizor,
|
||||
time_parser,
|
||||
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue