예제 #1
0
 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')
예제 #2
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>')
예제 #3
0
파일: license.py 프로젝트: priestd09/truepy
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')
예제 #4
0
 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')
예제 #5
0
파일: license.py 프로젝트: priestd09/truepy
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')
예제 #6
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]))
예제 #7
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>')
예제 #8
0
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')
예제 #9
0
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')
예제 #10
0
 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')
예제 #11
0
 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')
예제 #12
0
 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')
예제 #13
0
 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')
예제 #14
0
파일: bean.py 프로젝트: datalocker/truepy
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]))
예제 #15
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]))