Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioNar committed Jan 6, 2025
1 parent 6e57da2 commit e4a358a
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 84 deletions.
138 changes: 69 additions & 69 deletions tests/parsers/html/test_cellar_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,75 +159,75 @@ def test_get_articles(self):
}

article_2 = {
"eId": "art_2",
"num": "Article 2",
"heading": "Definitions",
"children": [
{
"eId": 0,
"text": "For the purposes of this Regulation, the following definitions apply:"
},
{
"eId": "(1)",
"text": "‘cross-border interoperability’ means the ability of Union entities and public sector bodies of Member States to interact with each other across borders by sharing data, information and knowledge through digital processes in line with the legal, organisational, semantic and technical requirements related to such cross-border interaction;"
},
{
"eId": "(2)",
"text": "‘trans-European digital public services’ means digital services provided by Union entities or public sector bodies to one another or to natural or legal persons in the Union, and requiring interaction across Member State borders, among Union entities or between Union entities and public sector bodies, by means of their network and information systems;"
},
{
"eId": "(3)",
"text": "‘network and information system’ means a network and information system as defined in Article 6, point (1), of Directive (EU) 2022/2555 of the European Parliament and of the Council ;"
},
{
"eId": "(4)",
"text": "‘interoperability solution’ means a reusable asset concerning legal, organisational, semantic or technical requirements to enable cross-border interoperability, such as conceptual frameworks, guidelines, reference architectures, technical specifications, standards, services and applications, as well as documented technical components, such as source code;"
},
{
"eId": "(5)",
"text": "‘Union entities’ means the Union institutions, bodies, offices and agencies set up by, or on the basis of, the TEU, the Treaty on the functioning of European Union or the Treaty establishing the European Atomic Energy Community;"
},
{
"eId": "(6)",
"text": "‘public sector body’ means a public sector body as defined in Article 2, point (1), of Directive (EU) 2019/1024 of the European Parliament and of the Council ;"
},
{
"eId": "(7)",
"text": "‘data’ means data as defined in Article 2, point (1), of Regulation (EU) 2022/868 of the European Parliament and of the Council ;"
},
{
"eId": "(8)",
"text": "‘machine-readable format’ means a machine-readable format as defined in Article 2, point (13), of Directive (EU) 2019/1024;"
},
{
"eId": "(9)",
"text": "‘GovTech’ means technology-based cooperation between public and private sector actors supporting public sector digital transformation;"
},
{
"eId": "(10)",
"text": "‘standard’ means a standard as defined in Article 2, point (1), of Regulation (EU) No 1025/2012 of the European Parliament and of the Council ;"
},
{
"eId": "(11)",
"text": "‘ICT technical specification’ means ICT technical specification as defined in Article 2, point (5), of Regulation (EU) No 1025/2012;"
},
{
"eId": "(12)",
"text": "‘open source licence’ means a licence whereby the reuse, redistribution and modification of software is permitted for all uses on the basis of a unilateral declaration by the right holder that may be subject to certain conditions, and where the source code of the software is made available to users indiscriminately;"
},
{
"eId": "(13)",
"text": "‘highest level of management’ means a manager, management or coordination and oversight body at the most senior administrative level, taking account of the high-level governance arrangements in each Union entity;"
},
{
"eId": "(14)",
"text": "‘interoperability regulatory sandbox’ means a controlled environment set up by a Union entity or a public sector body for the development, training, testing and validation of innovative interoperability solutions, where appropriate in real world conditions, supporting the cross-border interoperability of trans-European digital public services for a limited period of time under regulatory supervision;"
},
{
"eId": "(15)",
"text": "‘binding requirement’ means an obligation, prohibition, condition, criterion or limit of a legal, organisational, semantic or technical nature, which is set by a Union entity or a public sector body concerning one or more trans-European digital public services and which has an effect on cross-border interoperability."
}
]
"eId": "art_2",
"num": "Article 2",
"heading": "Definitions",
"children": [
{
"eId": 0,
"text": "For the purposes of this Regulation, the following definitions apply:"
},
{
"eId": 1,
"text": "‘cross-border interoperability’ means the ability of Union entities and public sector bodies of Member States to interact with each other across borders by sharing data, information and knowledge through digital processes in line with the legal, organisational, semantic and technical requirements related to such cross-border interaction;"
},
{
"eId": 2,
"text": "‘trans-European digital public services’ means digital services provided by Union entities or public sector bodies to one another or to natural or legal persons in the Union, and requiring interaction across Member State borders, among Union entities or between Union entities and public sector bodies, by means of their network and information systems;"
},
{
"eId": 3,
"text": "‘network and information system’ means a network and information system as defined in Article 6, point (1), of Directive (EU) 2022/2555 of the European Parliament and of the Council;"
},
{
"eId": 4,
"text": "‘interoperability solution’ means a reusable asset concerning legal, organisational, semantic or technical requirements to enable cross-border interoperability, such as conceptual frameworks, guidelines, reference architectures, technical specifications, standards, services and applications, as well as documented technical components, such as source code;"
},
{
"eId": 5,
"text": "‘Union entities’ means the Union institutions, bodies, offices and agencies set up by, or on the basis of, the TEU, the Treaty on the functioning of European Union or the Treaty establishing the European Atomic Energy Community;"
},
{
"eId": 6,
"text": "‘public sector body’ means a public sector body as defined in Article 2, point (1), of Directive (EU) 2019/1024 of the European Parliament and of the Council;"
},
{
"eId": 7,
"text": "‘data’ means data as defined in Article 2, point (1), of Regulation (EU) 2022/868 of the European Parliament and of the Council;"
},
{
"eId": 8,
"text": "‘machine-readable format’ means a machine-readable format as defined in Article 2, point (13), of Directive (EU) 2019/1024;"
},
{
"eId": 9,
"text": "‘GovTech’ means technology-based cooperation between public and private sector actors supporting public sector digital transformation;"
},
{
"eId": 10,
"text": "‘standard’ means a standard as defined in Article 2, point (1), of Regulation (EU) No 1025/2012 of the European Parliament and of the Council;"
},
{
"eId": 11,
"text": "‘ICT technical specification’ means ICT technical specification as defined in Article 2, point (5), of Regulation (EU) No 1025/2012;"
},
{
"eId": 12,
"text": "‘open source licence’ means a licence whereby the reuse, redistribution and modification of software is permitted for all uses on the basis of a unilateral declaration by the right holder that may be subject to certain conditions, and where the source code of the software is made available to users indiscriminately;"
},
{
"eId": 13,
"text": "‘highest level of management’ means a manager, management or coordination and oversight body at the most senior administrative level, taking account of the high-level governance arrangements in each Union entity;"
},
{
"eId": 14,
"text": "‘interoperability regulatory sandbox’ means a controlled environment set up by a Union entity or a public sector body for the development, training, testing and validation of innovative interoperability solutions, where appropriate in real world conditions, supporting the cross-border interoperability of trans-European digital public services for a limited period of time under regulatory supervision;"
},
{
"eId": 15,
"text": "‘binding requirement’ means an obligation, prohibition, condition, criterion or limit of a legal, organisational, semantic or technical nature, which is set by a Union entity or a public sector body concerning one or more trans-European digital public services and which has an effect on cross-border interoperability."
}
]
}

article_3 = {
Expand Down
30 changes: 15 additions & 15 deletions tests/parsers/xml/test_formex.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def test_get_citations(self):
self.parser.get_citations()

citations = [
{'eId': 0, 'text': "Having regard to the Treaty on the Functioning of the European Union,"},
{"eId": 1, 'text':"Having regard to Council Regulation (EC) No 1234/2007 of 22 October 2007 establishing a common organisation of agricultural markets and on specific provisions for certain agricultural products (Single CMO Regulation) , and in particular Article 143 thereof,"},
{"eId": 2, 'text':"Having regard to Council Regulation (EC) No 614/2009 of 7 July 2009 on the common system of trade for ovalbumin and lactalbumin , and in particular Article 3(4) thereof,"},
{'eId': "cit_1", 'text': "Having regard to the Treaty on the Functioning of the European Union,"},
{"eId": "cit_2", 'text':"Having regard to Council Regulation (EC) No 1234/2007 of 22 October 2007 establishing a common organisation of agricultural markets and on specific provisions for certain agricultural products (Single CMO Regulation) , and in particular Article 143 thereof,"},
{"eId": "cit_3", 'text':"Having regard to Council Regulation (EC) No 614/2009 of 7 July 2009 on the common system of trade for ovalbumin and lactalbumin , and in particular Article 3(4) thereof,"},
]

self.assertEqual(self.parser.citations, citations)
Expand All @@ -60,10 +60,10 @@ def test_get_recitals(self):
self.parser.get_recitals()

recitals = [
{"eId": "(1)", "text": "Commission Regulation (EC) No 1484/95 lays down detailed rules for implementing the system of additional import duties and fixes representative prices for poultrymeat and egg products and for egg albumin."},
{"eId": "(2)", "text": "Regular monitoring of the data used to determine representative prices for poultrymeat and egg products and for egg albumin shows that the representative import prices for certain products should be amended to take account of variations in price according to origin. The representative prices should therefore be published."},
{"eId": "(3)", "text": "In view of the situation on the market, this amendment should be applied as soon as possible."},
{"eId": "(4)", "text": "The measures provided for in this Regulation are in accordance with the opinion of the Management Committee for the Common Organisation of Agricultural Markets,"},
{"eId": "rct_1", "text": "Commission Regulation (EC) No 1484/95 lays down detailed rules for implementing the system of additional import duties and fixes representative prices for poultrymeat and egg products and for egg albumin."},
{"eId": "rct_2", "text": "Regular monitoring of the data used to determine representative prices for poultrymeat and egg products and for egg albumin shows that the representative import prices for certain products should be amended to take account of variations in price according to origin. The representative prices should therefore be published."},
{"eId": "rct_3", "text": "In view of the situation on the market, this amendment should be applied as soon as possible."},
{"eId": "rct_4", "text": "The measures provided for in this Regulation are in accordance with the opinion of the Management Committee for the Common Organisation of Agricultural Markets,"},
]

self.assertEqual(self.parser.recitals, recitals)
Expand All @@ -87,12 +87,12 @@ def test_get_chapters(self):
self.parser.get_chapters()

expected_chapters = [
{'eId': 0, 'num': 'Chapter 1', 'heading': 'General provisions'},
{'eId': 1, 'num': 'Chapter 2', 'heading': 'European Interoperability enablers'},
{'eId': 2, 'num': 'Chapter 3', 'heading': 'Interoperable Europe support measures'},
{'eId': 3, 'num': 'Chapter 4', 'heading': 'Governance of cross-border interoperability'},
{'eId': 4, 'num': 'Chapter 5', 'heading': 'Interoperable Europe planning and monitoring'},
{'eId': 5, 'num': 'Chapter 6', 'heading': 'Final provisions'},
{'eId': "cpt_1", 'num': 'Chapter 1', 'heading': 'General provisions'},
{'eId': "cpt_2", 'num': 'Chapter 2', 'heading': 'European Interoperability enablers'},
{'eId': "cpt_3", 'num': 'Chapter 3', 'heading': 'Interoperable Europe support measures'},
{'eId': "cpt_4", 'num': 'Chapter 4', 'heading': 'Governance of cross-border interoperability'},
{'eId': "cpt_5", 'num': 'Chapter 5', 'heading': 'Interoperable Europe planning and monitoring'},
{'eId': "cpt_6", 'num': 'Chapter 6', 'heading': 'Final provisions'},
]

self.assertEqual(self.parser.chapters[0], expected_chapters[0], "Chapters data does not match expected content")
Expand All @@ -104,15 +104,15 @@ def test_get_articles(self):
# Expected articles based on sample data in XML file
expected = [
{
"eId": "001",
"eId": "art_1",
"num": "Article 1",
"heading": None,
"children": [
{"eId": 0, "text": "Annex I to Regulation (EC) No 1484/95 is replaced by the Annex to this Regulation."}
]
},
{
"eId": "002",
"eId": "art_2",
"num": "Article 2",
"heading": None,
"children": [
Expand Down

0 comments on commit e4a358a

Please sign in to comment.