def test_log_name(self): """Test that incrementally numbered wtmp directories can be created""" with tempfile.TemporaryDirectory(suffix="make_wtmp_dir_test") as tmp_dir: tmp_dir = Path(tmp_dir) log_path = tmp_dir / "forkjoin-1-out.txt" with io.open(str(log_path), "w", encoding="utf-8", errors="replace") as f: f.writelines("test") self.assertEqual(fork_join.log_name(tmp_dir, 1, "out"), str(log_path))
def test_log_name(tmpdir): """Test that incrementally numbered wtmp directories can be created. Args: tmpdir (class): Fixture from pytest for creating a temporary directory """ tmpdir = Path(tmpdir) log_path = tmpdir / "forkjoin-1-out.txt" with io.open(str(log_path), "w", encoding="utf-8", errors="replace") as f: f.writelines("test") assert fork_join.log_name(tmpdir, 1, "out") == str(log_path)