1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
|
# Copyright (C) 2003-2021, Stefan Schwarzer <sschwarzer@sschwarzer.net>
# and ftputil contributors (see `doc/contributors.txt`)
# See the file LICENSE for licensing terms.
import datetime
import ftplib
import functools
import time
import pytest
import ftputil
import ftputil.error
import ftputil.path_encoding
import ftputil.tool
from test import test_base
from test import scripted_session
Call = scripted_session.Call
def as_bytes(string, encoding=ftputil.path_encoding.DEFAULT_ENCODING):
return string.encode(encoding)
class TestPath:
"""Test operations in `FTPHost.path`."""
# TODO: Add unit tests for changes for ticket #113 (commits [b4c9b089b6b8]
# and [4027740cdd2d]).
def test_regular_isdir_isfile_islink(self):
"""
Test regular `FTPHost._Path.isdir/isfile/islink`.
"""
# Test a path which isn't there.
script = [
Call("__init__"),
Call("pwd", result="/"),
# `isdir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
# `isfile` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
# `islink` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert not host.path.isdir("notthere")
assert not host.path.isfile("notthere")
assert not host.path.islink("notthere")
# This checks additional code (see ticket #66).
script = [
Call("__init__"),
Call("pwd", result="/"),
# `isdir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
# `isfile` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
# `islink` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert not host.path.isdir("/notthere/notthere")
assert not host.path.isfile("/notthere/notthere")
assert not host.path.islink("/notthere/notthere")
# Test a directory.
test_dir = "/some_dir"
dir_line = test_base.dir_line(
mode_string="dr-xr-xr-x",
datetime_=datetime.datetime.now(),
name=test_dir.lstrip("/"),
)
script = [
Call("__init__"),
Call("pwd", result="/"),
# `isdir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
# `isfile` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
# `islink` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert host.path.isdir(test_dir)
assert not host.path.isfile(test_dir)
assert not host.path.islink(test_dir)
# Test a file.
test_file = "/some_file"
dir_line = test_base.dir_line(
datetime_=datetime.datetime.now(), name=test_file.lstrip("/")
)
script = [
Call("__init__"),
Call("pwd", result="/"),
# `isdir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
# `isfile` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
# `islink` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert not host.path.isdir(test_file)
assert host.path.isfile(test_file)
assert not host.path.islink(test_file)
# Test a link. Since the link target doesn't exist, neither
# `isdir` nor `isfile` return `True`.
test_link = "/some_link"
dir_line = test_base.dir_line(
mode_string="lrwxrwxrwx",
datetime_=datetime.datetime.now(),
name=test_link.lstrip("/"),
link_target="nonexistent",
)
script = [
Call("__init__"),
Call("pwd", result="/"),
# `isdir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
# Look for `/some_link`
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
# Look for `/nonexistent`
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
# `isfile` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
# Look for `/some_link`
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
# Look for `/nonexistent`
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
# `islink` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
# Look for `/some_link`. `islink` doesn't try to dereference
# the link.
Call("dir", args=("",), result=dir_line),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert not host.path.isdir(test_link)
assert not host.path.isfile(test_link)
assert host.path.islink(test_link)
def test_workaround_for_spaces(self):
"""
Test whether the workaround for space-containing paths is used.
"""
# Test a file name containing spaces.
test_file = "/home/dir with spaces/file with spaces"
dir_line1 = test_base.dir_line(
mode_string="dr-xr-xr-x", datetime_=datetime.datetime.now(), name="home"
)
dir_line2 = test_base.dir_line(
mode_string="dr-xr-xr-x",
datetime_=datetime.datetime.now(),
name="dir with spaces",
)
dir_line3 = test_base.dir_line(
mode_string="-r--r--r--",
datetime_=datetime.datetime.now(),
name="file with spaces",
)
script = [
Call("__init__"),
Call("pwd", result="/"),
# `isdir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line1),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home",)),
Call("dir", args=("",), result=dir_line2),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home/dir with spaces",)),
Call("dir", args=("",), result=dir_line3),
Call("cwd", args=("/",)),
# `isfile` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line1),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home",)),
Call("dir", args=("",), result=dir_line2),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home/dir with spaces",)),
Call("dir", args=("",), result=dir_line3),
Call("cwd", args=("/",)),
# `islink` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line1),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home",)),
Call("dir", args=("",), result=dir_line2),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home/dir with spaces",)),
Call("dir", args=("",), result=dir_line3),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert not host.path.isdir(test_file)
assert host.path.isfile(test_file)
assert not host.path.islink(test_file)
def test_inaccessible_home_directory_and_whitespace_workaround(self):
"""
Test combination of inaccessible home directory + whitespace in path.
"""
script = [
Call("__init__"),
Call("pwd", result="/"),
Call("cwd", result=ftplib.error_perm),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
with pytest.raises(ftputil.error.InaccessibleLoginDirError):
host._dir("/home dir")
def test_isdir_isfile_islink_with_dir_failure(self):
"""
Test failing `FTPHost._Path.isdir/isfile/islink` because of failing
`_dir` call.
"""
script = [
Call("__init__"),
Call("pwd", result="/"),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=ftplib.error_perm),
Call("cwd", args=("/",)),
Call("close"),
]
FTPOSError = ftputil.error.FTPOSError
# Test if exceptions are propagated.
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
with pytest.raises(FTPOSError):
host.path.isdir("index.html")
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
with pytest.raises(FTPOSError):
host.path.isfile("index.html")
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
with pytest.raises(FTPOSError):
host.path.islink("index.html")
def test_isdir_isfile_with_infinite_link_chain(self):
"""
Test if `isdir` and `isfile` return `False` if they encounter an
infinite link chain.
"""
# `/home/bad_link` links to `/home/subdir/bad_link`, which links back
# to `/home/bad_link` etc.
dir_line1 = test_base.dir_line(
mode_string="dr-xr-xr-x", datetime_=datetime.datetime.now(), name="home"
)
dir_line2 = test_base.dir_line(
mode_string="lrwxrwxrwx",
datetime_=datetime.datetime.now(),
name="bad_link",
link_target="subdir/bad_link",
)
dir_line3 = test_base.dir_line(
mode_string="dr-xr-xr-x", datetime_=datetime.datetime.now(), name="subdir"
)
dir_line4 = test_base.dir_line(
mode_string="lrwxrwxrwx",
datetime_=datetime.datetime.now(),
name="bad_link",
link_target="/home/bad_link",
)
script = [
Call("__init__"),
Call("pwd", result="/"),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line1),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home",)),
Call("dir", args=("",), result=dir_line2 + "\n" + dir_line3),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/home/subdir",)),
Call("dir", args=("",), result=dir_line4),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
assert host.path.isdir("/home/bad_link") is False
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
assert host.path.isfile("/home/bad_link") is False
def test_exists(self):
"""
Test `FTPHost.path.exists`.
"""
# Regular use of `exists`
dir_line1 = test_base.dir_line(
datetime_=datetime.datetime.now(), name="some_file"
)
script = [
Call("__init__"),
Call("pwd", result="/"),
# `exists("some_file")`
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line1),
Call("cwd", args=("/",)),
# `exists("notthere")`
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=dir_line1),
Call("cwd", args=("/",)),
# `exists` with failing `dir` call
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=ftplib.error_perm),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert host.path.exists("some_file")
assert not host.path.exists("notthere")
# Test if exceptions are propagated.
with pytest.raises(ftputil.error.FTPOSError):
host.path.exists("some_file")
class TestAcceptEitherBytesOrStr:
# Use path arguments directly
path_converter = staticmethod(lambda path: path)
def _test_method_string_types(self, method, path):
expected_type = type(path)
path_converter = self.path_converter
assert isinstance(method(path_converter(path)), expected_type)
def test_methods_that_take_and_return_one_string(self):
"""
Test whether the same string type as for the argument is returned.
"""
method_names = [
"abspath",
"basename",
"dirname",
"join",
"normcase",
"normpath",
]
script = [Call("__init__"), Call("pwd", result="/"), Call("close")]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
for method_name in method_names:
method = getattr(host.path, method_name)
self._test_method_string_types(method, "/")
self._test_method_string_types(method, ".")
self._test_method_string_types(method, b"/")
self._test_method_string_types(method, b".")
def test_methods_that_take_a_string_and_return_a_bool(self):
"""
Test whether the methods accept byte and unicode strings.
"""
path_converter = self.path_converter
script = [
Call("__init__"),
Call("pwd", result="/"),
# `exists` test 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(name="ä", datetime_=datetime.datetime.now()),
),
Call("cwd", args=("/",)),
# `exists` test 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(name="ä", datetime_=datetime.datetime.now()),
),
Call("cwd", args=("/",)),
# `isdir` test 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(
mode_string="dr-xr-xr-x",
name="ä",
datetime_=datetime.datetime.now(),
),
),
Call("cwd", args=("/",)),
# `isdir` test 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(
mode_string="dr-xr-xr-x",
name="ä",
datetime_=datetime.datetime.now(),
),
),
Call("cwd", args=("/",)),
# `isfile` test 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(name="ö", datetime_=datetime.datetime.now()),
),
Call("cwd", args=("/",)),
# `isfile` test 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(name="ö", datetime_=datetime.datetime.now()),
),
Call("cwd", args=("/",)),
# `islink` test 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(
mode_string="lrwxrwxrwx",
name="ü",
datetime_=datetime.datetime.now(),
link_target="unimportant",
),
),
Call("cwd", args=("/",)),
# `islink` test 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(
mode_string="lrwxrwxrwx",
name="ü",
datetime_=datetime.datetime.now(),
link_target="unimportant",
),
),
Call("cwd", args=("/",)),
Call("close"),
]
custom_as_bytes = functools.partial(
as_bytes, encoding=ftputil.path_encoding.FTPLIB_DEFAULT_ENCODING
)
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
# `isabs`
assert not host.path.isabs("ä")
assert not host.path.isabs(path_converter(custom_as_bytes("ä")))
# `exists`
assert host.path.exists(path_converter("ä"))
assert host.path.exists(path_converter(custom_as_bytes("ä")))
# `isdir`, `isfile`, `islink`
assert host.path.isdir(path_converter("ä"))
assert host.path.isdir(path_converter(custom_as_bytes("ä")))
assert host.path.isfile(path_converter("ö"))
assert host.path.isfile(path_converter(custom_as_bytes("ö")))
assert host.path.islink(path_converter("ü"))
assert host.path.islink(path_converter(custom_as_bytes("ü")))
def test_getmtime(self):
"""
Test whether `FTPHost.path.getmtime` accepts byte and unicode paths.
"""
path_converter = self.path_converter
now = datetime.datetime.now(datetime.timezone.utc)
script = [
Call("__init__"),
Call("pwd", result="/"),
# `getmtime` call 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=test_base.dir_line(name="ä", datetime_=now)),
Call("cwd", args=("/",)),
# `getmtime` call 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("dir", args=("",), result=test_base.dir_line(name="ä", datetime_=now)),
Call("cwd", args=("/",)),
Call("close"),
]
expected_mtime = now.timestamp()
# We don't care about the _exact_ time, so don't bother with timezone
# differences. Instead, do a simple sanity check.
day = 24 * 60 * 60 # seconds
mtime_makes_sense = (
lambda mtime: expected_mtime - day <= mtime <= expected_mtime + day
)
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert mtime_makes_sense(host.path.getmtime(path_converter(("ä"))))
assert mtime_makes_sense(
host.path.getmtime(
path_converter(
as_bytes("ä", ftputil.path_encoding.FTPLIB_DEFAULT_ENCODING)
)
)
)
def test_getsize(self):
"""
Test whether `FTPHost.path.getsize` accepts byte and unicode paths.
"""
path_converter = self.path_converter
now = datetime.datetime.now()
script = [
Call("__init__"),
Call("pwd", result="/"),
# `getsize` call 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(name="ä", size=512, datetime_=now),
),
Call("cwd", args=("/",)),
# `getsize` call 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(name="ä", size=512, datetime_=now),
),
Call("cwd", args=("/",)),
Call("close"),
]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
assert host.path.getsize(path_converter("ä")) == 512
assert (
host.path.getsize(
path_converter(
as_bytes("ä", ftputil.path_encoding.FTPLIB_DEFAULT_ENCODING)
)
)
== 512
)
def test_walk(self):
"""
Test whether `FTPHost.path.walk` accepts bytes and unicode paths.
"""
path_converter = self.path_converter
now = datetime.datetime.now()
script = [
Call("__init__"),
Call("pwd", result="/"),
# `walk` call 1
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(
mode_string="dr-xr-xr-x", name="ä", size=512, datetime_=now
),
),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/ä",)),
# Assume directory `ä` is empty.
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
# `walk` call 2
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call(
"dir",
args=("",),
result=test_base.dir_line(
mode_string="dr-xr-xr-x", name="ä", size=512, datetime_=now
),
),
Call("cwd", args=("/",)),
Call("cwd", args=("/",)),
Call("cwd", args=("/ä",)),
# Assume directory `ä` is empty.
Call("dir", args=("",), result=""),
Call("cwd", args=("/",)),
Call("close"),
]
def noop(arg, top, names):
del names[:]
with test_base.ftp_host_factory(scripted_session.factory(script)) as host:
host.stat_cache.disable()
host.path.walk(path_converter("ä"), func=noop, arg=None)
host.path.walk(
path_converter(
as_bytes("ä", ftputil.path_encoding.FTPLIB_DEFAULT_ENCODING)
),
func=noop,
arg=None,
)
class Path:
def __init__(self, path):
self.path = path
def __fspath__(self):
return self.path
class TestAcceptEitherBytesOrStrFromPath(TestAcceptEitherBytesOrStr):
# Take path arguments from `Path(...)` objects
path_converter = Path
|