Renamed builder to parser
This commit is contained in:
parent
c9cfb46314
commit
53c38df80d
|
@ -134,9 +134,9 @@ class Value:
|
|||
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()
|
||||
specifications = Specifications()
|
||||
div_elements = xpath_find(root, 'tei:div')
|
||||
|
|
|
@ -2,14 +2,14 @@ import os.path
|
|||
import lxml.etree as lxml
|
||||
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):
|
||||
|
||||
def setUp(self):
|
||||
specifications_file_name = os.path.join(os.path.dirname(__file__), '../resources/msd-sl.spc.xml')
|
||||
builder = SpecificationsBuilder()
|
||||
specifications = builder.build(specifications_file_name)
|
||||
parser = SpecificationsParser()
|
||||
specifications = parser.parse(specifications_file_name)
|
||||
self.converter = Converter(specifications)
|
||||
|
||||
def test_en_en(self):
|
||||
|
|
|
@ -2,14 +2,14 @@ import os.path
|
|||
import lxml.etree as lxml
|
||||
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):
|
||||
|
||||
def setUp(self):
|
||||
specifications_file_name = os.path.join(os.path.dirname(__file__), '../resources/msd-sl.spc.xml')
|
||||
builder = SpecificationsBuilder()
|
||||
specifications = builder.build(specifications_file_name)
|
||||
parser = SpecificationsParser()
|
||||
specifications = parser.parse(specifications_file_name)
|
||||
self.converter = Converter(specifications)
|
||||
|
||||
def test_en_en(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user