Example #1
0
 def test_invalid(self):
     invalid_samples = [
         ":asd::",
         "asd:asd::",
     ]
     for test_sample in invalid_samples:
         assert not ENTITY_PATTERN.findall(test_sample)
Example #2
0
    def test_oneline_no_params(self):
        test_string = "asdasd ::test:: asdasdsa"
        res_match = ENTITY_PATTERN.findall(test_string)

        assert len(res_match) == 1
        assert res_match[0][0] == 'test'
        assert res_match[0][1] == ''
        assert res_match[0][2] == ''
Example #3
0
    def test_multiline_with_params(self):
        test_string = """asdasd ::test:this::
asdasdsa:::"""
        res_match = ENTITY_PATTERN.findall(test_string)

        assert len(res_match) == 1
        assert res_match[0][0] == 'test'
        assert res_match[0][1] == 'this'
        assert res_match[0][2] == '\nasdasdsa'
Example #4
0
    def test_multiline_no_params(self):
        test_string = """asdasd ::test::
asdasdsa:::
lkdmfv;dfv
sdlmvskdmfvsdfv
dfvls;dmfvm;sdfvs

::test2::
AAAAAAAAA:::"""
        res_match = ENTITY_PATTERN.findall(test_string)

        assert len(res_match) == 2
        assert res_match[0][0] == 'test'
        assert res_match[0][1] == ''
        assert res_match[0][2] == '\nasdasdsa'
        assert res_match[1][0] == 'test2'
        assert res_match[1][1] == ''
        assert res_match[1][2] == '\nAAAAAAAAA'