python-ballchasing 0.5.3__tar.gz → 0.5.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/PKG-INFO +1 -1
  2. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/pyproject.toml +1 -1
  3. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/python_ballchasing.egg-info/PKG-INFO +1 -1
  4. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/tests/test_fixes.py +9 -0
  5. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/LICENSE +0 -0
  6. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/README.md +0 -0
  7. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/__init__.py +0 -0
  8. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/api.py +2 -2
  9. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/constants.py +0 -0
  10. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/rate_limit.py +0 -0
  11. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/stats_info.tsv +0 -0
  12. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/typed/__init__.py +0 -0
  13. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/typed/deep_group.py +0 -0
  14. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/typed/deep_replay.py +0 -0
  15. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/typed/shallow_group.py +0 -0
  16. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/typed/shallow_replay.py +0 -0
  17. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/typed/shared.py +0 -0
  18. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/util/__init__.py +0 -0
  19. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/util/dates.py +0 -0
  20. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/util/iterators.py +0 -0
  21. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/util/replays.py +0 -0
  22. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/ballchasing/util/stats.py +0 -0
  23. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/python_ballchasing.egg-info/SOURCES.txt +0 -0
  24. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/python_ballchasing.egg-info/dependency_links.txt +0 -0
  25. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/python_ballchasing.egg-info/requires.txt +0 -0
  26. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/python_ballchasing.egg-info/top_level.txt +0 -0
  27. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/scripts/get_maps.py +0 -0
  28. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/scripts/make_types.py +0 -0
  29. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/scripts/test.py +0 -0
  30. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/scripts/test_typed.py +0 -0
  31. {python_ballchasing-0.5.3 → python_ballchasing-0.5.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ballchasing
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: A Python wrapper around the Ballchasing API
5
5
  Author-email: Rolv-Arild Braaten <rolv_arild@hotmail.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-ballchasing"
7
- version = "0.5.3"
7
+ version = "0.5.4"
8
8
  authors = [
9
9
  { name = "Rolv-Arild Braaten", email = "rolv_arild@hotmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ballchasing
3
- Version: 0.5.3
3
+ Version: 0.5.4
4
4
  Summary: A Python wrapper around the Ballchasing API
5
5
  Author-email: Rolv-Arild Braaten <rolv_arild@hotmail.com>
6
6
  License: MIT License
@@ -116,6 +116,15 @@ class TestHttpRetryAndLogging:
116
116
  assert mock_sleep.call_count == 1
117
117
  assert mock_sleep.call_args[0][0] >= 1.0
118
118
 
119
+ def test_initial_ping_with_rate_limiter(self):
120
+ # Ensure that do_initial_ping=True does not raise AttributeError: no attribute rate_limiter
121
+ mock_resp = make_mock_response(status_code=200, json_data={"name": "TestUser", "type": "champion"})
122
+ with patch("requests.sessions.Session.request", return_value=mock_resp):
123
+ api = BallchasingApi("dummy_key", do_initial_ping=True, proactive_rate_limit=True)
124
+ assert api.steam_name == "TestUser"
125
+ assert api.patron_type == "champion"
126
+ assert hasattr(api, "rate_limiter")
127
+
119
128
  def test_rate_limit_retries_indefinitely(self):
120
129
  api = BallchasingApi("dummy_key", sleep_time_on_rate_limit=0.125, do_initial_ping=False)
121
130
  # Simulate 10 consecutive 429s followed by a 200 OK
@@ -61,8 +61,6 @@ class BallchasingApi:
61
61
  self._ping_result = None
62
62
  self.rate_limit_count = 0
63
63
  self.base_url = DEFAULT_URL if base_url is None else base_url
64
- if do_initial_ping:
65
- self.ping()
66
64
  self._sleep_time_on_rate_limit = sleep_time_on_rate_limit
67
65
  self.print_on_rate_limit = print_on_rate_limit
68
66
  self.typed = typed
@@ -70,6 +68,8 @@ class BallchasingApi:
70
68
  patron_type_getter=lambda: self._ping_result.get("type") if self._ping_result else None,
71
69
  proactive=proactive_rate_limit,
72
70
  )
71
+ if do_initial_ping:
72
+ self.ping()
73
73
 
74
74
  @property
75
75
  def sleep_time_on_rate_limit(self) -> float: