updated tests to current format of converters, updated static/not-static decorators on base class to match its children, added GoogleConverter, moved one or two methods to the base class because they all work the same.

This commit is contained in:
2019-03-07 02:30:48 -05:00
parent 6333f55c87
commit d30ecad583
16 changed files with 346 additions and 46 deletions

View File

@@ -0,0 +1,32 @@
import json
import os
import pytest
from transcript_processing.converters.google import (
make_json_friendly,
GoogleConverter,
)
from transcript_processing.config import GOOGLE_TRANSCRIPT_TEST_FILE
@pytest.fixture
def transcript():
with open(GOOGLE_TRANSCRIPT_TEST_FILE, 'r') as fin:
return fin.read()
def test_make_json_friendly(transcript):
friendly = make_json_friendly(transcript)
assert json.loads(friendly)
def test_pre_process(transcript):
with open(os.getenv('GOOGLE_TRANSCRIPT_TEST_FILE'), 'r') as fin:
transcript_data = fin.read()
g = GoogleConverter(transcript_data)
assert g.json_data