Пример #1
0
    def test_remove_signature_and_is_signed_corner_cases(self):
        assert not unsign.is_signed(None)
        assert unsign.remove_signature(None) == None

        assert not unsign.is_signed('')
        assert unsign.remove_signature('') == ''

        assert not unsign.is_signed('\n')
        assert unsign.remove_signature('\n') == '\n'

        assert not unsign.is_signed('sometext\n')
        assert unsign.remove_signature('sometext\n') == 'sometext\n'
Пример #2
0
 def test_is_signed4(self):
     text = '''-----END PGP SIGNATURE-----'''
     assert not unsign.is_signed(text)
Пример #3
0
 def test_is_signed3(self):
     text = '''-----BEGIN PGP SIGNED MESSAGE-----'''
     assert not unsign.is_signed(text)
Пример #4
0
 def test_is_signed2(self):
     text = '''-----BEGIN PGP SIGNED MESSAGE-----
     -----END PGP SIGNATURE-----'''
     assert unsign.is_signed(text)
Пример #5
0
 def test_remove_signature_and_is_signed_compact(self):
     assert unsign.is_signed(COMPACT)
     assert unsign.remove_signature(COMPACT) == EXPECTED_COMPACT
Пример #6
0
 def test_remove_signature_and_is_signed_signed(self):
     assert unsign.is_signed(SIGNED)
     assert unsign.remove_signature(SIGNED) == EXPECTED_SIGNED
Пример #7
0
 def test_remove_signature_and_is_signed_empty_signed(self):
     assert unsign.is_signed(EMPTY)
     assert unsign.remove_signature(EMPTY) == '\n'
Пример #8
0
 def test_remove_signature_and_is_signed_not_signed(self):
     assert not unsign.is_signed(PLAIN)
     assert unsign.remove_signature(PLAIN) == PLAIN