mirror of
https://github.com/panda3d/panda3d.git
synced 2026-05-02 12:40:15 -05:00
22 lines
482 B
Python
22 lines
482 B
Python
from panda3d.core import Filename
|
|
import sys, os
|
|
import pytest
|
|
|
|
|
|
def test_filename_fspath():
|
|
fn = Filename.from_os_specific(__file__)
|
|
assert os.fspath(fn) == fn.to_os_specific_w()
|
|
|
|
|
|
def test_filename_open():
|
|
fn = Filename.from_os_specific(__file__)
|
|
open(fn, 'rb')
|
|
|
|
|
|
def test_filename_ctor_pathlib():
|
|
pathlib = pytest.importorskip('pathlib')
|
|
|
|
path = pathlib.Path(__file__)
|
|
fn = Filename(path)
|
|
assert fn.to_os_specific_w().lower() == str(path).lower()
|