| 1 |
# (C) Copyright 2004-2023 Enthought, Inc., Austin, TX |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# This software is provided without warranty under the terms of the BSD |
| 5 |
# license included in LICENSE.txt and may be redistributed only under |
| 6 |
# the conditions described in the aforementioned license. The license |
| 7 |
# is also available online at http://www.enthought.com/licenses/BSD.txt |
| 8 |
# |
| 9 |
# Thanks for using Enthought open source! |
| 10 |
|
| 11 |
""" This file provides tests for the demo of the same name located in the |
| 12 |
directory one level up. |
| 13 |
""" |
| 14 |
import os |
| 15 |
import runpy |
| 16 |
import unittest |
| 17 |
|
| 18 |
#: Filename of the demo script |
| 19 |
FILENAME = "Image_editor_demo.py" |
| 20 |
|
| 21 |
#: Path of the demo script |
| 22 |
DEMO_PATH = os.path.join(os.path.dirname(__file__), "..", FILENAME) |
| 23 |
|
| 24 |
|
| 25 |
class TestImageEditorDemo(unittest.TestCase): |
| 26 |
def test_image_path_exists(self): |
| 27 |
(search_path,) = runpy.run_path(DEMO_PATH)["search_path"] |
| 28 |
self.assertTrue(os.path.exists(search_path)) |
| 29 |
|
| 30 |
|
| 31 |
# Run the test(s) |
| 32 |
unittest.TextTestRunner().run( |
| 33 |
unittest.TestLoader().loadTestsFromTestCase(TestImageEditorDemo) |
| 34 |
) |