From 53c38df80dbf7b792b9a9d6d369cf7dcc4c016b7 Mon Sep 17 00:00:00 2001 From: Cyprian Laskowski Date: Fri, 10 Sep 2021 15:30:04 +0200 Subject: [PATCH] Renamed builder to parser --- conversion_utils/jos_msds_and_properties.py | 4 ++-- tests/test_jos_msd_to_properties.py | 6 +++--- tests/test_jos_properties_to_msd.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conversion_utils/jos_msds_and_properties.py b/conversion_utils/jos_msds_and_properties.py index 20c61ff..64c12c0 100644 --- a/conversion_utils/jos_msds_and_properties.py +++ b/conversion_utils/jos_msds_and_properties.py @@ -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') diff --git a/tests/test_jos_msd_to_properties.py b/tests/test_jos_msd_to_properties.py index abd7eb2..4f0bcc3 100644 --- a/tests/test_jos_msd_to_properties.py +++ b/tests/test_jos_msd_to_properties.py @@ -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): diff --git a/tests/test_jos_properties_to_msd.py b/tests/test_jos_properties_to_msd.py index ba7c272..32a5b41 100644 --- a/tests/test_jos_properties_to_msd.py +++ b/tests/test_jos_properties_to_msd.py @@ -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):