Append X

Write a function append_x that receives a string and appends the character 'X' to it ONLY if the string is not empty:

append_x('hello')  # hellox
append_x('')  # ''
import unittest


class AppendXTestCase(unittest.TestCase):

    def test_with_valid_string(self):
        self.assertEqual(append_x('abc_'), 'abc_x')

    def test_with_empty_string(self):
        self.assertEqual(append_x(''), '')