/usr/lib/python3/dist-packages/pyutilib/component/loader/tests/test_load2.py is in python3-pyutilib 5.3.5-1.
This file is owned by root:root, with mode 0o644.
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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #
# Plugin load tests, with the sys.path loader disabled.
#
import os
import sys
from os.path import abspath, dirname
currdir = dirname(abspath(__file__))+os.sep
import pyutilib.th as unittest
import pyutilib.subprocess
try:
import yaml
yaml_available=True
except ImportError:
yaml_available=False
class Test(unittest.TestCase):
def test_load1(self):
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load1.py", currdir, "json"])
self.assertMatchesJsonBaseline(currdir+"load1.out", currdir+"load1.jsn")
if yaml_available:
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load1.py", currdir, "yaml"])
self.assertMatchesYamlBaseline(currdir+"load1.out", currdir+"load1.yml")
def test_load1a(self):
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load1a.py", currdir, "json"])
self.assertMatchesJsonBaseline(currdir+"load1a.out", currdir+"load1a.jsn")
if yaml_available:
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load1a.py", currdir, "yaml"])
self.assertMatchesYamlBaseline(currdir+"load1a.out", currdir+"load1a.yml")
def test_load2(self):
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load2.py", currdir, "json"])
self.assertMatchesJsonBaseline(currdir+"load2.out", currdir+"load2.jsn")
if yaml_available:
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load2.py", currdir, "yaml"])
self.assertMatchesYamlBaseline(currdir+"load2.out", currdir+"load2.yml")
def test_load2a(self):
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load2a.py", currdir, "json"])
self.assertMatchesJsonBaseline(currdir+"load2a.out", currdir+"load2a.jsn")
if yaml_available:
pyutilib.subprocess.run([sys.executable, currdir+os.sep+"load2a.py", currdir, "yaml"])
self.assertMatchesYamlBaseline(currdir+"load2a.out", currdir+"load2a.yml")
if __name__ == "__main__":
unittest.main()
|