mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-12-13 15:19:05 +00:00
Refactored unit tests
This commit is contained in:
18
test/test_TextFileParser.py
Normal file
18
test/test_TextFileParser.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from unittest import TestCase
|
||||
from parsing import TextFileParser
|
||||
import os
|
||||
|
||||
dir_name = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class TextFileParserTest(TestCase):
|
||||
|
||||
def test_parse_csv(self):
|
||||
|
||||
parser = TextFileParser([], 1234, "test_files/")
|
||||
|
||||
info = parser.parse(dir_name + "/test_files/text.csv")
|
||||
|
||||
self.assertTrue(info["content"].startswith("rosbagTimestamp,header,seq,stamp,secs,nsecs,"))
|
||||
self.assertEqual(len(info["content"]), 1309) # Size is larger because of html escaping
|
||||
self.assertEqual(info["encoding"], "ascii")
|
||||
Reference in New Issue
Block a user