6 from typing
import Iterator, Optional
9 @contextlib.contextmanager
12 if sys.version_info >= (3, 2):
13 with tempfile.TemporaryDirectory()
as td:
16 td = tempfile.mkdtemp()
28 ret = os.path.join(path,
"msg")
29 if message_name
is None:
32 return os.path.join(ret,
"{}.msg".format(message_name))
37 ret = os.path.join(path,
"srv")
38 if service_name
is None:
41 return os.path.join(ret,
"{}.srv".format(service_name))
46 expected_path = os.path.join(expeced_dir, filename)
47 actual_path = os.path.join(actual_dir, filename)
49 assert os.path.exists(expected_path),
"Expected file not found" 50 assert os.path.exists(actual_path),
"File is not generated with the expected name" 52 with open(expected_path)
as f:
55 with open(actual_path)
as f:
58 assert expected == actual
def message_path(path, message_name=None)
def assert_output_equals(expeced_dir, actual_dir, filename)
def temporary_directory()
def service_path(path, service_name=None)