()
| 560 | |
| 561 | |
| 562 | def test_file_info_constructor(): |
| 563 | dt = datetime.fromtimestamp(1568799826, timezone.utc) |
| 564 | |
| 565 | info = FileInfo("foo/bar") |
| 566 | assert info.path == "foo/bar" |
| 567 | assert info.base_name == "bar" |
| 568 | assert info.type == FileType.Unknown |
| 569 | assert info.size is None |
| 570 | check_mtime_absent(info) |
| 571 | |
| 572 | info = FileInfo("foo/baz.txt", type=FileType.File, size=123, |
| 573 | mtime=1568799826.5) |
| 574 | assert info.path == "foo/baz.txt" |
| 575 | assert info.base_name == "baz.txt" |
| 576 | assert info.type == FileType.File |
| 577 | assert info.size == 123 |
| 578 | assert info.mtime_ns == 1568799826500000000 |
| 579 | check_mtime(info) |
| 580 | |
| 581 | info = FileInfo("foo", type=FileType.Directory, mtime=dt) |
| 582 | assert info.path == "foo" |
| 583 | assert info.base_name == "foo" |
| 584 | assert info.type == FileType.Directory |
| 585 | assert info.size is None |
| 586 | assert info.mtime == dt |
| 587 | assert info.mtime_ns == 1568799826000000000 |
| 588 | check_mtime(info) |
| 589 | |
| 590 | |
| 591 | def test_cannot_instantiate_base_filesystem(): |
nothing calls this directly
no test coverage detected