/usr/lib/python2.7/dist-packages/charmtools/templates/python_services/files/unit_tests/test_actions.py is in charm-tools 2.1.2-0ubuntu4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/usr/bin/env python
import sys
import mock
import unittest
from pkg_resources import resource_filename
# allow importing actions from the hooks directory
sys.path.append(resource_filename(__name__, '../hooks'))
import actions
class TestActions(unittest.TestCase):
@mock.patch('charmhelpers.core.hookenv.log')
def test_log_start(self, log):
actions.log_start('test-service')
log.assert_called_once_with('$metadata.package starting')
if __name__ == '__main__':
unittest.main()
|