github.phpd.cn/thought-machine/please@v12.2.0+incompatible/test/python_rules/data_dep_test.py (about) 1 """Test on deps, data, requires and provides.""" 2 3 import os 4 import subprocess 5 import unittest 6 7 8 class DataDepTest(unittest.TestCase): 9 10 def test_direct_dep(self): 11 """Test that we can import the module directly.""" 12 from test.python_rules import data_dep 13 self.assertEqual(42, data_dep.the_answer()) 14 15 def test_data_dep(self): 16 """Test that we can also invoke the .pex directly as a data dependency.""" 17 output = subprocess.check_output(['test/python_rules/data_dep.pex']) 18 self.assertEqual('42', output.strip().decode('utf-8'))