def test_signature_algorithm_valid_non_default_signature_algo(self): """Tests License() for valid, non-default signature_algorithm""" License( to_document(serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_algorithm='HELLOwithWORLD')
def test_encoded_valid(self): """Tests that License() with valid encoded data has correct encoded value""" License( to_document(serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>')
def License_signature_encoding0(): """Tests License() for invalid signature_encoding""" with assert_exception(ValueError): License(to_document(serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_encoding = 'UTF-8/Base64')
def test_signature_algorithm_valid_non_default_signature_algo(self): """Tests License() for valid, non-default signature_algorithm""" License(to_document( serialize(LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_algorithm='HELLOwithWORLD')
def License_signature_algorithm0(): """Tests License() for invalid signature_algorithm""" with assert_exception(ValueError): License(to_document(serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_algorithm = 'invalid')
def test_to_document(self): """Tests that todocument creates a valid XML document""" expected = 'hello world' self.assertEqual( expected, deserialize(fromstring(to_document(serialize(expected)))[0]))
def test_encoded_valid(self): """Tests that License() with valid encoded data has correct encoded value""" License( to_document( serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>')
def License_signature_encoding0(): """Tests License() for invalid signature_encoding""" with assert_exception(ValueError): License(to_document( serialize(LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_encoding='UTF-8/Base64')
def License_signature_algorithm0(): """Tests License() for invalid signature_algorithm""" with assert_exception(ValueError): License(to_document( serialize(LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_algorithm='invalid')
def test_signature_encoding_invalid(self): """Tests License() for invalid signature_encoding""" with self.assertRaises(ValueError): License(to_document( serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_encoding='UTF-8/Base64')
def test_signature_algorithm_invalid(self): """Tests License() for invalid signature_algorithm""" with self.assertRaises(ValueError): License(to_document( serialize( LicenseData('2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_algorithm='invalid')
def test_signature_encoding_invalid(self): """Tests License() for invalid signature_encoding""" with self.assertRaises(ValueError): License( to_document(serialize( LicenseData( '2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_encoding='UTF-8/Base64')
def test_signature_algorithm_invalid(self): """Tests License() for invalid signature_algorithm""" with self.assertRaises(ValueError): License( to_document(serialize( LicenseData( '2014-01-01T00:00:00', '2014-01-01T00:00:01'))), '<signature>', signature_algorithm='invalid')
def to_document0(): """Tests that to_document creates a valid XML document""" expected = 'hello world' assert_eq( expected, deserialize( fromstring( to_document( serialize(expected))) [0]))
def test_to_document(self): """Tests that todocument creates a valid XML document""" expected = 'hello world' self.assertEqual( expected, deserialize( fromstring( to_document( serialize(expected))) [0]))