Exemplo n.º 1
0
 def __init__(self, transform=None):
     self.transform = transform
     self.test_dir = get_test_dir()
     self.filenames = np.array([
         fn for fn in os.listdir(self.test_dir)
         if fn.lower().endswith('.png')
     ])
Exemplo n.º 2
0
 def test_entries_correctness(self):
     reference_path = os.path.join(get_test_dir(), '2015-11-28-hot-100.txt')
     with open(reference_path) as reference:
         self.assertEqual(str(self.chart), reference.read())
 def test_entries_correctness(self):
     reference_path = os.path.join(get_test_dir(), '2015-11-28-hot-100.txt')
     with open(reference_path) as reference:
         self.assertEqual(str(self.chart), reference.read())
#!/usr/bin/env python
"""
Test invalid line removal
"""

from asrtoolkit.convert_transcript import convert
from asrtoolkit.data_structures.time_aligned_text import time_aligned_text
from utils import get_sample_dir, get_test_dir

test_dir = get_test_dir(__file__)
sample_dir = get_sample_dir(__file__)


EXPECTED_UNFORMATTED_TRANSCRIPTS = (
    "testing testing one two three or maybe ten four",
    "testing testing one two three",
    "testing testing one two three",
)

EXPECTED_FORMATTED_TRANSCRIPTS = (
    "testing testing one two three or maybe 10 4",
    "testing testing one two three",
    "testing testing, one two three!",
)


def validate_sample(ext, expected_transcripts, out_segments):
    base_output = f"{test_dir}/good"
    convert(f"{sample_dir}/invalid.stm", base_output + ext)
    validated_transcript = time_aligned_text(base_output + ext)
    assert len(validated_transcript.segments) == out_segments
 def test_entries_correctness(self):
     reference_path = os.path.join(get_test_dir(),
                                   '2017-03-04-digital-albums.txt')
     with open(reference_path) as reference:
         self.assertEqual(str(self.chart), reference.read())
Exemplo n.º 6
0
 def test_entries_correctness(self):
     reference_path = os.path.join(get_test_dir(),
                                   '2014-07-26-artist-100.txt')
     with open(reference_path) as reference:
         assert str(self.chart) == reference.read()
Exemplo n.º 7
0
 def test_correct_entries(self):
     reference_path = os.path.join(get_test_dir(), '2015-11-28-hot-100.txt')
     with open(reference_path) as reference:
         assert str(self.chart) == reference.read()
 def test_entries_correctness(self):
     reference_path = os.path.join(get_test_dir(),
                                   '2015-year-end-top-artist.txt')
     with open(reference_path) as reference:
         self.assertEqual(str(self.chart), reference.read())
 def test_entries_correctness(self):
     reference_path = os.path.join(get_test_dir(),
                                   '2017-03-04-digital-albums.txt')
     with open(reference_path) as reference:
         self.assertEqual(str(self.chart), reference.read())