Renamed builder to parser

This commit is contained in:
Cyprian Laskowski 2021-09-10 15:30:04 +02:00
parent c9cfb46314
commit 53c38df80d
3 changed files with 8 additions and 8 deletions

View File

@ -134,9 +134,9 @@ class Value:
format(codes=self.codes, names=self.names) format(codes=self.codes, names=self.names)
class SpecificationsBuilder: class SpecificationsParser:
def build(self, file_name): def parse(self, file_name):
root = lxml.parse(file_name).getroot() root = lxml.parse(file_name).getroot()
specifications = Specifications() specifications = Specifications()
div_elements = xpath_find(root, 'tei:div') div_elements = xpath_find(root, 'tei:div')

View File

@ -2,14 +2,14 @@ import os.path
import lxml.etree as lxml import lxml.etree as lxml
import unittest import unittest
from conversion_utils.jos_msds_and_properties import SpecificationsBuilder, Converter, Msd from conversion_utils.jos_msds_and_properties import SpecificationsParser, Converter, Msd
class JosMsdToPropertiesTestCase(unittest.TestCase): class JosMsdToPropertiesTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
specifications_file_name = os.path.join(os.path.dirname(__file__), '../resources/msd-sl.spc.xml') specifications_file_name = os.path.join(os.path.dirname(__file__), '../resources/msd-sl.spc.xml')
builder = SpecificationsBuilder() parser = SpecificationsParser()
specifications = builder.build(specifications_file_name) specifications = parser.parse(specifications_file_name)
self.converter = Converter(specifications) self.converter = Converter(specifications)
def test_en_en(self): def test_en_en(self):

View File

@ -2,14 +2,14 @@ import os.path
import lxml.etree as lxml import lxml.etree as lxml
import unittest import unittest
from conversion_utils.jos_msds_and_properties import SpecificationsBuilder, Converter, Properties from conversion_utils.jos_msds_and_properties import SpecificationsParser, Converter, Properties
class JosPropertiesToMsdTestCase(unittest.TestCase): class JosPropertiesToMsdTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
specifications_file_name = os.path.join(os.path.dirname(__file__), '../resources/msd-sl.spc.xml') specifications_file_name = os.path.join(os.path.dirname(__file__), '../resources/msd-sl.spc.xml')
builder = SpecificationsBuilder() parser = SpecificationsParser()
specifications = builder.build(specifications_file_name) specifications = parser.parse(specifications_file_name)
self.converter = Converter(specifications) self.converter = Converter(specifications)
def test_en_en(self): def test_en_en(self):