()
| 752 | |
| 753 | |
| 754 | def test_cache_options(): |
| 755 | opts1 = pa.CacheOptions() |
| 756 | opts2 = pa.CacheOptions(hole_size_limit=1024) |
| 757 | opts3 = pa.CacheOptions(hole_size_limit=4096, range_size_limit=8192) |
| 758 | opts4 = pa.CacheOptions(hole_size_limit=4096, |
| 759 | range_size_limit=8192, prefetch_limit=5) |
| 760 | opts5 = pa.CacheOptions(hole_size_limit=4096, |
| 761 | range_size_limit=8192, lazy=False) |
| 762 | opts6 = pa.CacheOptions.from_network_metrics(time_to_first_byte_millis=100, |
| 763 | transfer_bandwidth_mib_per_sec=200, |
| 764 | ideal_bandwidth_utilization_frac=0.9, |
| 765 | max_ideal_request_size_mib=64) |
| 766 | |
| 767 | assert opts1.hole_size_limit == 8192 |
| 768 | assert opts1.range_size_limit == 32 * 1024 * 1024 |
| 769 | assert opts1.lazy is True |
| 770 | assert opts1.prefetch_limit == 0 |
| 771 | |
| 772 | assert opts2.hole_size_limit == 1024 |
| 773 | assert opts2.range_size_limit == 32 * 1024 * 1024 |
| 774 | assert opts2.lazy is True |
| 775 | assert opts2.prefetch_limit == 0 |
| 776 | |
| 777 | assert opts3.hole_size_limit == 4096 |
| 778 | assert opts3.range_size_limit == 8192 |
| 779 | assert opts3.lazy is True |
| 780 | assert opts3.prefetch_limit == 0 |
| 781 | |
| 782 | assert opts4.hole_size_limit == 4096 |
| 783 | assert opts4.range_size_limit == 8192 |
| 784 | assert opts4.lazy is True |
| 785 | assert opts4.prefetch_limit == 5 |
| 786 | |
| 787 | assert opts5.hole_size_limit == 4096 |
| 788 | assert opts5.range_size_limit == 8192 |
| 789 | assert opts5.lazy is False |
| 790 | assert opts5.prefetch_limit == 0 |
| 791 | |
| 792 | assert opts6.lazy is False |
| 793 | |
| 794 | assert opts1 == opts1 |
| 795 | assert opts1 != opts2 |
| 796 | assert opts2 != opts3 |
| 797 | assert opts3 != opts4 |
| 798 | assert opts4 != opts5 |
| 799 | assert opts6 != opts1 |
| 800 | |
| 801 | |
| 802 | def test_cache_options_pickling(pickle_module): |
nothing calls this directly
no outgoing calls
no test coverage detected