示例#1
0
    def test_str_encode(self):
        '''
        Test for The value to be encoded.
        '''
        self.assertRaises(SaltInvocationError, mod_random.str_encode, 'None',
                          'abc')

        self.assertRaises(SaltInvocationError, mod_random.str_encode, None)

        if six.PY2:
            self.assertEqual(mod_random.str_encode('A'), 'QQ==\n')
        else:
            # We're using the base64 module which does not include the trailing new line
            self.assertEqual(mod_random.str_encode('A'), 'QQ==')
示例#2
0
    def test_str_encode(self):
        """
        Test for The value to be encoded.
        """
        self.assertRaises(SaltInvocationError, mod_random.str_encode, "None",
                          "abc")

        self.assertRaises(SaltInvocationError, mod_random.str_encode, None)

        if six.PY2:
            self.assertEqual(mod_random.str_encode("A"), "QQ==\n")
        else:
            # We're using the base64 module which does not include the trailing new line
            self.assertEqual(mod_random.str_encode("A"), "QQ==")
示例#3
0
def test_str_encode():
    """
    Test for The value to be encoded.
    """
    pytest.raises(SaltInvocationError, mod_random.str_encode, "None", "abc")
    pytest.raises(SaltInvocationError, mod_random.str_encode, None)
    assert mod_random.str_encode("A") == "QQ=="
示例#4
0
    def test_str_encode(self):
        '''
        Test for The value to be encoded.
        '''
        self.assertRaises(SaltInvocationError, mod_random.str_encode, 'None',
                          'abc')

        self.assertRaises(SaltInvocationError, mod_random.str_encode, None)

        self.assertEqual(mod_random.str_encode('A'), 'QQ==\n')
示例#5
0
    def test_str_encode(self):
        '''
        Test for The value to be encoded.
        '''
        self.assertRaises(SaltInvocationError,
                          mod_random.str_encode, 'None', 'abc')

        self.assertRaises(SaltInvocationError,
                          mod_random.str_encode, None)

        self.assertEqual(mod_random.str_encode('A'), 'QQ==\n')