コード例 #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
ファイル: mod_random_test.py プロジェクト: lvg01/salt.old
    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
ファイル: mod_random_test.py プロジェクト: DaveQB/salt
    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')