def test_extract2(self): self.assert_refs([{ 'resource': 'law/extract2.txt', 'refs': [ Ref(ref_type=RefType.LAW, book='vwgo', section='124'), Ref(ref_type=RefType.LAW, book='vwgo', section='124a'), ] }])
def test_extract2(self): self.assert_refs([{ "resource": "law/extract2.txt", "refs": [ Ref(ref_type=RefType.LAW, book="vwgo", section="124"), Ref(ref_type=RefType.LAW, book="vwgo", section="124a"), ], }])
def test_extract3(self): self.assert_refs([{ "resource": "law/extract3.txt", "refs": [ Ref(ref_type=RefType.LAW, book="vwgo", section="167"), Ref(ref_type=RefType.LAW, book="zpo", section="708"), Ref(ref_type=RefType.LAW, book="zpo", section="711"), ], }])
def test_extract20(self): self.assert_refs([{ 'resource': 'law/extract20.txt', 'refs': [ Ref(ref_type=RefType.LAW, book='vwgo', section='154'), Ref(ref_type=RefType.LAW, book='vwgo', section='154'), Ref(ref_type=RefType.LAW, book='vwgo', section='162'), ] }], True)
def test_extract16(self): self.assert_refs([{ 'resource': 'law/extract16.txt', 'refs': [ Ref(ref_type=RefType.LAW, book='vwgo', section='167'), Ref(ref_type=RefType.LAW, book='zpo', section='708'), Ref(ref_type=RefType.LAW, book='zpo', section='711'), ] }], True)
def test_extract11(self): self.assert_refs([{ "resource": "law/extract11.txt", "refs": [ # §§ 556d, 556g BGB Ref(ref_type=RefType.LAW, book="bgb", section="556d"), Ref(ref_type=RefType.LAW, book="bgb", section="556e"), ], }])
def test_extract14(self): self.assert_refs([{ "resource": "law/extract14.txt", "refs": [ # duplicated book code parts Ref(ref_type=RefType.LAW, book="sgg", section="136"), Ref(ref_type=RefType.LAW, book="sgb x", section="48"), ], }])
def test_extract11(self): self.assert_refs([{ 'resource': 'law/extract11.txt', 'refs': [ # §§ 556d, 556g BGB Ref(ref_type=RefType.LAW, book='bgb', section='556d'), Ref(ref_type=RefType.LAW, book='bgb', section='556e'), ] }])
def test_extract14(self): self.assert_refs([{ 'resource': 'law/extract14.txt', 'refs': [ # duplicated book code parts Ref(ref_type=RefType.LAW, book='sgg', section='136'), Ref(ref_type=RefType.LAW, book='sgb x', section='48'), ] }])
def test_extract4(self): self.assert_refs([{ "resource": "law/extract4.txt", "refs": [ Ref(ref_type=RefType.LAW, book="baugb", section="34"), Ref(ref_type=RefType.LAW, book="baunvo", section="2"), Ref(ref_type=RefType.LAW, book="baunvo", section="3"), Ref(ref_type=RefType.LAW, book="baunvo", section="4"), ], }])
def test_extract9(self): self.assert_refs([{ 'resource': 'law/extract9.txt', 'refs': [ # §§ 52 Abs. 1; 53 Abs. 2 Nr. 1; 63 Abs. 2 StPO Ref(ref_type=RefType.LAW, book='stpo', section='52'), Ref(ref_type=RefType.LAW, book='stpo', section='53'), Ref(ref_type=RefType.LAW, book='stpo', section='63'), ] }])
def test_extract9(self): self.assert_refs([{ "resource": "law/extract9.txt", "refs": [ # §§ 52 Abs. 1; 53 Abs. 2 Nr. 1; 63 Abs. 2 StPO Ref(ref_type=RefType.LAW, book="stpo", section="52"), Ref(ref_type=RefType.LAW, book="stpo", section="53"), Ref(ref_type=RefType.LAW, book="stpo", section="63"), ], }])
def test_extract17(self): self.assert_refs([{ 'resource': 'law/extract17.txt', 'refs': [ Ref(ref_type=RefType.LAW, book='baugb', section='34'), Ref(ref_type=RefType.LAW, book='baunvo', section='2'), Ref(ref_type=RefType.LAW, book='baunvo', section='3'), Ref(ref_type=RefType.LAW, book='baunvo', section='4'), ] }], True)
def test_extract13(self): self.assert_refs([{ 'resource': 'law/extract13.txt', 'refs': [ # § 3d AsylG, aber auch § 123 VwGO. ... auch §§ 3, 3b AsylG Ref(ref_type=RefType.LAW, book='asylg', section='3'), Ref(ref_type=RefType.LAW, book='asylg', section='3b'), Ref(ref_type=RefType.LAW, book='asylg', section='3d'), Ref(ref_type=RefType.LAW, book='vwgo', section='123'), ] }])
def test_extract12(self): self.assert_refs([{ 'resource': 'law/extract12.txt', 'refs': [ # §§ 1, 2 Abs. 2, 3, 10 Abs. 1 Nr. 1 BGB Ref(ref_type=RefType.LAW, book='bgb', section='1'), Ref(ref_type=RefType.LAW, book='bgb', section='2'), Ref(ref_type=RefType.LAW, book='bgb', section='3'), Ref(ref_type=RefType.LAW, book='bgb', section='10'), ] }])
def test_extract12(self): self.assert_refs([{ "resource": "law/extract12.txt", "refs": [ # §§ 1, 2 Abs. 2, 3, 10 Abs. 1 Nr. 1 BGB Ref(ref_type=RefType.LAW, book="bgb", section="1"), Ref(ref_type=RefType.LAW, book="bgb", section="2"), Ref(ref_type=RefType.LAW, book="bgb", section="3"), Ref(ref_type=RefType.LAW, book="bgb", section="10"), ], }])
def test_extract13(self): self.assert_refs([{ "resource": "law/extract13.txt", "refs": [ # § 3d AsylG, aber auch § 123 VwGO. ... auch §§ 3, 3b AsylG Ref(ref_type=RefType.LAW, book="asylg", section="3"), Ref(ref_type=RefType.LAW, book="asylg", section="3b"), Ref(ref_type=RefType.LAW, book="asylg", section="3d"), Ref(ref_type=RefType.LAW, book="vwgo", section="123"), ], }])
def test_extract20(self): self.assert_refs( [{ "resource": "law/extract20.txt", "refs": [ Ref(ref_type=RefType.LAW, book="vwgo", section="154"), Ref(ref_type=RefType.LAW, book="vwgo", section="154"), Ref(ref_type=RefType.LAW, book="vwgo", section="162"), ], }], True, )
def test_extract10(self): self.assert_refs([{ "resource": "law/extract10.txt", "refs": [ # Art 12 Abs 1 GG Ref(ref_type=RefType.LAW, book="gg", section="1"), Ref(ref_type=RefType.LAW, book="gg", section="2"), Ref(ref_type=RefType.LAW, book="gg", section="3"), Ref(ref_type=RefType.LAW, book="gg", section="12"), # Ref(ref_type=RefType.LAW, book='stpo', section='53'), # Ref(ref_type=RefType.LAW, book='stpo', section='63'), ], }])
def test_extract10(self): self.assert_refs([{ 'resource': 'law/extract10.txt', 'refs': [ # Art 12 Abs 1 GG Ref(ref_type=RefType.LAW, book='gg', section='1'), Ref(ref_type=RefType.LAW, book='gg', section='2'), Ref(ref_type=RefType.LAW, book='gg', section='3'), Ref(ref_type=RefType.LAW, book='gg', section='12'), # Ref(ref_type=RefType.LAW, book='stpo', section='53'), # Ref(ref_type=RefType.LAW, book='stpo', section='63'), ] }])
def test_extract19(self): self.assert_refs( [{ "resource": "law/extract19.txt", "refs": [Ref(ref_type=RefType.LAW, book="vwgo", section="42")], }], True, )
def test_extract19(self): self.assert_refs([ { 'resource': 'law/extract19.txt', 'refs': [ Ref(ref_type=RefType.LAW, book='vwgo', section='42') ] } ], True)
def test_extract8(self): self.assert_refs([{ 'resource': 'law/extract8.txt', 'refs': [ # § 77 Abs. 1 Satz 1, 1. Halbsatz AsylG Ref(ref_type=RefType.LAW, book='asylg', section='77') ] }])
def test_extract8(self): self.assert_refs([{ "resource": "law/extract8.txt", "refs": [ # § 77 Abs. 1 Satz 1, 1. Halbsatz AsylG Ref(ref_type=RefType.LAW, book="asylg", section="77") ], }])
def test_catastrophic_backtracking(self): self.extractor.law_book_codes = self.get_book_codes_from_file() self.assert_refs([{ 'resource': 'bgh_2018-08-16.html', 'refs': [ # catastrophic_backtracking Ref(ref_type=RefType.LAW, book='zpo', section='253'), # Ref(ref_type=RefType.CASE, file_number='III ZR 126/15') ] }])
def test_catastrophic_backtracking(self): self.extractor.law_book_codes = self.get_book_codes_from_file() self.assert_refs([{ "resource": "bgh_2018-08-16.html", "refs": [ # catastrophic_backtracking Ref(ref_type=RefType.LAW, book="zpo", section="253"), # Ref(ref_type=RefType.CASE, file_number='III ZR 126/15') ], }])
def test_replace_content(self): text = '§ 123 ABC' marker = RefMarker(text, 0, len(text)) marker.uuid = 'foo' marker.references = [ Ref(ref_type=RefType.LAW, book='abc', section=123) ] content = text + ' and other text...' self.assertEqual('[ref=foo]§ 123 ABC[/ref] and other text...', marker.replace_content(content, 0)[0], 'Invalid content')
def test_replace_content(self): text = "§ 123 ABC" marker = RefMarker(text, 0, len(text)) marker.uuid = "foo" marker.references = [ Ref(ref_type=RefType.LAW, book="abc", section=123) ] content = text + " and other text..." self.assertEqual( "[ref=foo]§ 123 ABC[/ref] and other text...", marker.replace_content(content, 0)[0], "Invalid content", )
def test_extract_case_refs_detail(self): fixtures = [{ 'content': 'Rückwirkend zum 01.01.2014 trat das Gesetz zur Neufassung des Landesplanungsgesetzes (LaplaG) und zur Aufhebung ' 'des Landesentwicklungsgrundsätzegesetzes' ' vom 27.01.2014 (GVOBl. 12). Das OVG Schleswig habe bereits in seinem Urteil vom 22.04.2010 (1 KN 19/09) zur ' 'im Wesentlichen gleichlautenden Vorgängervorschrift im LROP-TF 2004 festgestellt, dass dieser Vorschrift die' ' erforderliche Bestimmtheit bzw. Bestimmbarkeit und damit die Zielqualität nicht zukomme.', 'refs': [ Ref(ref_type=RefType.CASE, court='OVG Schleswig', file_number='1 KN 19/09') # , date=date(2010, 4, 22) ] }] self.assert_refs(fixtures)
def test_timeout_ref(self): expected = [{ 'content': ' Auslandsaufenthalt mit beachtlicher Wahrscheinlichkeit aufgrund eines ihm (zugeschriebenen) Verfolgungsgrundes ' 'im Sinne des § 3 Abs. 1 AsylG, insbesondere einer regimekritischen politischen Überzeugung, erfolgen würden. ' 'Nach der Rechtsprechung des schleswig-holsteinischen Oberverwaltungsgerichtes (Urteil vom 23.11.2016, - 3 LB 17/16 -, juris), ' 'der sich die Kammer anschließt, besteht nach der gegenwärtigen Erkenntnislage keine hinreichende' ' Grundlage für die Annahme, dass der totalitäre syrische Staat jeden Rückkehrer pauschal unter eine ' 'Art Generalsverdacht stellt, der Opposition anzugehören (so auch OVG Saarland, ' 'Urteil vom 2.2.2017, - 2 A 515/16 -; OVG Rheinland-Pfalz, Urteil vom 16.12.2016, -1A 10922/16 -; Bayrischer VGH, ' 'Urteil vom 12.12.16, - 21 B 16.30364; OVG Nordrhein-Westfalen,', 'refs': [ Ref(ref_type=RefType.LAW, book='asylg', section='3'), ] }] self.assert_refs(expected)