class JWKOctTest(unittest.TestCase): """Tests for letsencrypt.acme.jose.jwk.JWKOct.""" def setUp(self): from letsencrypt.acme.jose.jwk import JWKOct self.jwk = JWKOct(key='foo') self.jobj = {'kty': 'oct', 'k': 'foo'} def test_to_partial_json(self): self.assertEqual(self.jwk.to_partial_json(), self.jobj) def test_from_json(self): from letsencrypt.acme.jose.jwk import JWKOct self.assertEqual(self.jwk, JWKOct.from_json(self.jobj)) def test_from_json_hashable(self): from letsencrypt.acme.jose.jwk import JWKOct hash(JWKOct.from_json(self.jobj)) def test_load(self): from letsencrypt.acme.jose.jwk import JWKOct self.assertEqual(self.jwk, JWKOct.load('foo')) def test_public(self): self.assertTrue(self.jwk.public() is self.jwk)
class JWKOctTest(unittest.TestCase): """Tests for letsencrypt.acme.jose.jwk.JWKOct.""" def setUp(self): from letsencrypt.acme.jose.jwk import JWKOct self.jwk = JWKOct(key='foo') self.jobj = {'kty': 'oct', 'k': 'foo'} def test_to_json(self): self.assertEqual(self.jwk.to_json(), self.jobj) def test_from_json(self): from letsencrypt.acme.jose.jwk import JWKOct self.assertEqual(self.jwk, JWKOct.from_json(self.jobj)) def test_load(self): from letsencrypt.acme.jose.jwk import JWKOct self.assertEqual(self.jwk, JWKOct.load('foo')) def test_public(self): self.assertTrue(self.jwk.public() is self.jwk)
def test_load(self): from letsencrypt.acme.jose.jwk import JWKOct self.assertEqual(self.jwk, JWKOct.load('foo'))
def test_from_json(self): from letsencrypt.acme.jose.jwk import JWKOct self.assertEqual(self.jwk, JWKOct.from_json(self.jobj))
def setUp(self): from letsencrypt.acme.jose.jwk import JWKOct self.jwk = JWKOct(key='foo') self.jobj = {'kty': 'oct', 'k': 'foo'}
def test_from_json_hashable(self): from letsencrypt.acme.jose.jwk import JWKOct hash(JWKOct.from_json(self.jobj))