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==')
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==")
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=="
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')