Linux newlinux5.pouyasazan.org 3.10.0-962.3.2.lve1.5.60.el7.x86_64 #1 SMP Fri Jul 23 07:07:00 EDT 2021 x86_64
LiteSpeed
Server IP : 88.99.66.243 & Your IP : 216.73.216.178
Domains :
Cant Read [ /etc/named.conf ]
User : wdbbsgxf
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
josepy /
Delete
Unzip
Name
Size
Permission
Date
Action
testdata
[ DIR ]
drwxr-xr-x
2022-02-05 00:54
__init__.py
1.88
KB
-rw-r--r--
2020-01-28 21:21
__init__.pyc
2.45
KB
-rw-r--r--
2020-03-24 12:30
__init__.pyo
2.45
KB
-rw-r--r--
2020-03-24 12:30
b64.py
1.47
KB
-rw-r--r--
2020-01-28 21:21
b64.pyc
1.87
KB
-rw-r--r--
2020-03-24 12:30
b64.pyo
1.87
KB
-rw-r--r--
2020-03-24 12:30
b64_test.py
2.27
KB
-rw-r--r--
2020-01-28 21:21
b64_test.pyc
4.22
KB
-rw-r--r--
2020-03-24 12:30
b64_test.pyo
4.22
KB
-rw-r--r--
2020-03-24 12:30
errors.py
815
B
-rw-r--r--
2020-01-28 21:21
errors.pyc
1.88
KB
-rw-r--r--
2020-03-24 12:30
errors.pyo
1.88
KB
-rw-r--r--
2020-03-24 12:30
errors_test.py
463
B
-rw-r--r--
2020-01-28 21:21
errors_test.pyc
1.04
KB
-rw-r--r--
2020-03-24 12:30
errors_test.pyo
1.04
KB
-rw-r--r--
2020-03-24 12:30
interfaces.py
7.67
KB
-rw-r--r--
2020-01-28 21:21
interfaces.pyc
8.48
KB
-rw-r--r--
2020-03-24 12:30
interfaces.pyo
8.48
KB
-rw-r--r--
2020-03-24 12:30
interfaces_test.py
3.54
KB
-rw-r--r--
2020-01-28 21:21
interfaces_test.pyc
6.25
KB
-rw-r--r--
2020-03-24 12:30
interfaces_test.pyo
6.25
KB
-rw-r--r--
2020-03-24 12:30
json_util.py
15.38
KB
-rw-r--r--
2020-01-28 21:21
json_util.pyc
17.33
KB
-rw-r--r--
2020-03-24 12:30
json_util.pyo
17.33
KB
-rw-r--r--
2020-03-24 12:30
json_util_test.py
13.94
KB
-rw-r--r--
2020-01-28 21:21
json_util_test.pyc
19.88
KB
-rw-r--r--
2020-03-24 12:30
json_util_test.pyo
19.88
KB
-rw-r--r--
2020-03-24 12:30
jwa.py
6.11
KB
-rw-r--r--
2020-01-28 21:21
jwa.pyc
7.75
KB
-rw-r--r--
2020-03-24 12:30
jwa.pyo
7.75
KB
-rw-r--r--
2020-03-24 12:30
jwa_test.py
4.54
KB
-rw-r--r--
2020-01-28 21:21
jwa_test.pyc
6.66
KB
-rw-r--r--
2020-03-24 12:30
jwa_test.pyo
6.66
KB
-rw-r--r--
2020-03-24 12:30
jwk.py
9.19
KB
-rw-r--r--
2020-01-28 21:21
jwk.pyc
10.5
KB
-rw-r--r--
2020-03-24 12:30
jwk.pyo
10.5
KB
-rw-r--r--
2020-03-24 12:30
jwk_test.py
6.92
KB
-rw-r--r--
2020-01-28 21:21
jwk_test.pyc
9.29
KB
-rw-r--r--
2020-03-24 12:30
jwk_test.pyo
9.29
KB
-rw-r--r--
2020-03-24 12:30
jws.py
13.93
KB
-rw-r--r--
2020-01-28 21:21
jws.pyc
15.53
KB
-rw-r--r--
2020-03-24 12:30
jws.pyo
15.02
KB
-rw-r--r--
2020-03-24 12:30
jws_test.py
8.32
KB
-rw-r--r--
2020-01-28 21:21
jws_test.pyc
11.65
KB
-rw-r--r--
2020-03-24 12:30
jws_test.pyo
11.65
KB
-rw-r--r--
2020-03-24 12:30
magic_typing.py
371
B
-rw-r--r--
2020-01-28 21:21
magic_typing.pyc
816
B
-rw-r--r--
2020-03-24 12:30
magic_typing.pyo
816
B
-rw-r--r--
2020-03-24 12:30
magic_typing_test.py
1.45
KB
-rw-r--r--
2020-01-28 21:21
magic_typing_test.pyc
1.6
KB
-rw-r--r--
2020-03-24 12:30
magic_typing_test.pyo
1.6
KB
-rw-r--r--
2020-03-24 12:30
test_util.py
2.23
KB
-rw-r--r--
2020-01-28 21:21
test_util.pyc
3.27
KB
-rw-r--r--
2020-03-24 12:30
test_util.pyo
3.27
KB
-rw-r--r--
2020-03-24 12:30
util.py
7.41
KB
-rw-r--r--
2020-01-28 21:21
util.pyc
11.18
KB
-rw-r--r--
2020-03-24 12:30
util.pyo
11.08
KB
-rw-r--r--
2020-03-24 12:30
util_test.py
6.45
KB
-rw-r--r--
2020-01-28 21:21
util_test.pyc
11.53
KB
-rw-r--r--
2020-03-24 12:30
util_test.pyo
11.53
KB
-rw-r--r--
2020-03-24 12:30
Save
Rename
"""Tests for josepy.util.""" import functools import unittest import six from josepy import test_util class ComparableX509Test(unittest.TestCase): """Tests for josepy.util.ComparableX509.""" def setUp(self): # test_util.load_comparable_{csr,cert} return ComparableX509 self.req1 = test_util.load_comparable_csr('csr.pem') self.req2 = test_util.load_comparable_csr('csr.pem') self.req_other = test_util.load_comparable_csr('csr-san.pem') self.cert1 = test_util.load_comparable_cert('cert.pem') self.cert2 = test_util.load_comparable_cert('cert.pem') self.cert_other = test_util.load_comparable_cert('cert-san.pem') def test_getattr_proxy(self): self.assertTrue(self.cert1.has_expired()) def test_eq(self): self.assertEqual(self.req1, self.req2) self.assertEqual(self.cert1, self.cert2) def test_ne(self): self.assertNotEqual(self.req1, self.req_other) self.assertNotEqual(self.cert1, self.cert_other) def test_ne_wrong_types(self): self.assertNotEqual(self.req1, 5) self.assertNotEqual(self.cert1, 5) def test_hash(self): self.assertEqual(hash(self.req1), hash(self.req2)) self.assertNotEqual(hash(self.req1), hash(self.req_other)) self.assertEqual(hash(self.cert1), hash(self.cert2)) self.assertNotEqual(hash(self.cert1), hash(self.cert_other)) def test_repr(self): for x509 in self.req1, self.cert1: self.assertEqual(repr(x509), '<ComparableX509({0!r})>'.format(x509.wrapped)) class ComparableRSAKeyTest(unittest.TestCase): """Tests for josepy.util.ComparableRSAKey.""" def setUp(self): # test_utl.load_rsa_private_key return ComparableRSAKey self.key = test_util.load_rsa_private_key('rsa256_key.pem') self.key_same = test_util.load_rsa_private_key('rsa256_key.pem') self.key2 = test_util.load_rsa_private_key('rsa512_key.pem') def test_getattr_proxy(self): self.assertEqual(256, self.key.key_size) def test_eq(self): self.assertEqual(self.key, self.key_same) def test_ne(self): self.assertNotEqual(self.key, self.key2) def test_ne_different_types(self): self.assertNotEqual(self.key, 5) def test_ne_not_wrapped(self): # pylint: disable=protected-access self.assertNotEqual(self.key, self.key_same._wrapped) def test_ne_no_serialization(self): from josepy.util import ComparableRSAKey self.assertNotEqual(ComparableRSAKey(5), ComparableRSAKey(5)) def test_hash(self): self.assertTrue(isinstance(hash(self.key), int)) self.assertEqual(hash(self.key), hash(self.key_same)) self.assertNotEqual(hash(self.key), hash(self.key2)) def test_repr(self): self.assertTrue(repr(self.key).startswith( '<ComparableRSAKey(<cryptography.hazmat.')) def test_public_key(self): from josepy.util import ComparableRSAKey self.assertTrue(isinstance(self.key.public_key(), ComparableRSAKey)) class ImmutableMapTest(unittest.TestCase): """Tests for josepy.util.ImmutableMap.""" def setUp(self): # pylint: disable=invalid-name,too-few-public-methods # pylint: disable=missing-docstring from josepy.util import ImmutableMap class A(ImmutableMap): __slots__ = ('x', 'y') class B(ImmutableMap): __slots__ = ('x', 'y') self.A = A self.B = B self.a1 = self.A(x=1, y=2) self.a1_swap = self.A(y=2, x=1) self.a2 = self.A(x=3, y=4) self.b = self.B(x=1, y=2) def test_update(self): self.assertEqual(self.A(x=2, y=2), self.a1.update(x=2)) self.assertEqual(self.a2, self.a1.update(x=3, y=4)) def test_get_missing_item_raises_key_error(self): self.assertRaises(KeyError, self.a1.__getitem__, 'z') def test_order_of_args_does_not_matter(self): self.assertEqual(self.a1, self.a1_swap) def test_type_error_on_missing(self): self.assertRaises(TypeError, self.A, x=1) self.assertRaises(TypeError, self.A, y=2) def test_type_error_on_unrecognized(self): self.assertRaises(TypeError, self.A, x=1, z=2) self.assertRaises(TypeError, self.A, x=1, y=2, z=3) def test_get_attr(self): self.assertEqual(1, self.a1.x) self.assertEqual(2, self.a1.y) self.assertEqual(1, self.a1_swap.x) self.assertEqual(2, self.a1_swap.y) def test_set_attr_raises_attribute_error(self): self.assertRaises( AttributeError, functools.partial(self.a1.__setattr__, 'x'), 10) def test_equal(self): self.assertEqual(self.a1, self.a1) self.assertEqual(self.a2, self.a2) self.assertNotEqual(self.a1, self.a2) def test_hash(self): self.assertEqual(hash((1, 2)), hash(self.a1)) def test_unhashable(self): self.assertRaises(TypeError, self.A(x=1, y={}).__hash__) def test_repr(self): self.assertEqual('A(x=1, y=2)', repr(self.a1)) self.assertEqual('A(x=1, y=2)', repr(self.a1_swap)) self.assertEqual('B(x=1, y=2)', repr(self.b)) self.assertEqual("B(x='foo', y='bar')", repr(self.B(x='foo', y='bar'))) class frozendictTest(unittest.TestCase): # pylint: disable=invalid-name """Tests for josepy.util.frozendict.""" def setUp(self): from josepy.util import frozendict self.fdict = frozendict(x=1, y='2') def test_init_dict(self): from josepy.util import frozendict self.assertEqual(self.fdict, frozendict({'x': 1, 'y': '2'})) def test_init_other_raises_type_error(self): from josepy.util import frozendict # specifically fail for generators... self.assertRaises(TypeError, frozendict, six.iteritems({'a': 'b'})) def test_len(self): self.assertEqual(2, len(self.fdict)) def test_hash(self): self.assertTrue(isinstance(hash(self.fdict), int)) def test_getattr_proxy(self): self.assertEqual(1, self.fdict.x) self.assertEqual('2', self.fdict.y) def test_getattr_raises_attribute_error(self): self.assertRaises(AttributeError, self.fdict.__getattr__, 'z') def test_setattr_immutable(self): self.assertRaises(AttributeError, self.fdict.__setattr__, 'z', 3) def test_repr(self): self.assertEqual("frozendict(x=1, y='2')", repr(self.fdict)) if __name__ == '__main__': unittest.main() # pragma: no cover