Skip to content

Commit 29b4b44

Browse files
authored
Merge pull request #27 from Galarzaa90/dev
2 parents 509b7fe + 2d0c159 commit 29b4b44

File tree

9 files changed

+221
-46
lines changed

9 files changed

+221
-46
lines changed

.gitlab-ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
image: python:3.6
1+
image: python:3.8
22

33
variables:
44
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
55
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
6-
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
6+
GIT_DEPTH: 10
77
DOCKER_DRIVER: overlay2
88

99
before_script:
1010
- python -m venv venv
1111
- source venv/bin/activate
12-
- pip install -U -e .
13-
- pip install -U -e .[docs]
14-
- pip install -U -e .[test]
1512

1613
stages:
1714
- build
@@ -29,6 +26,7 @@ cache:
2926
build:
3027
stage: build
3128
script:
29+
- pip install -U -e .
3230
- pip install wheel
3331
- python setup.py sdist bdist_wheel
3432
artifacts:
@@ -40,10 +38,11 @@ sonarcloud-check:
4038
stage: analyze
4139
image:
4240
name: sonarsource/sonar-scanner-cli:latest
43-
entrypoint: [""]
41+
entrypoint: [ "" ]
42+
before_script:
43+
- git fetch --unshallow origin +refs/heads/*:refs/remotes/origin/*
4444
script:
4545
- sonar-scanner
46-
before_script: []
4746
dependencies:
4847
- coverage
4948
only:
@@ -54,6 +53,7 @@ sonarcloud-check:
5453
docs:
5554
stage: build
5655
script:
56+
- pip install -U -e .[docs]
5757
- cd docs
5858
- make html
5959
artifacts:
@@ -64,10 +64,11 @@ docs:
6464
coverage:
6565
stage: test
6666
script:
67-
- coverage run setup.py test
68-
- coverage report
69-
- coverage html
70-
- coverage xml
67+
- pip install -U -e .[test]
68+
- coverage run setup.py test
69+
- coverage report
70+
- coverage html
71+
- coverage xml
7172
artifacts:
7273
name: Coverage_Report
7374
paths:
@@ -76,9 +77,12 @@ coverage:
7677

7778
pages:
7879
stage: deploy
80+
image: alpine
81+
cache: { }
7982
dependencies:
8083
- docs
8184
- coverage
85+
before_script: [ ]
8286
script:
8387
- mkdir public
8488
- mv htmlcov/ public/coverage/

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ Changelog
66
Due to this library relying on external content, older versions are not guaranteed to work.
77
Try to always use the latest version.
88

9+
.. v3.7.0:
10+
11+
3.7.0 (2021-02-09)
12+
==================
13+
14+
- Parse familiars from auctions
15+
- Updated the way tooltips in auctions are parsed, the format changed, resulting in the previous code not working anymore.
16+
- Results count in bazaar pages are now properly parsed when there are comma thousand separators.
17+
- Item amounts are now more accurate instead of being based from their indicator (which was grouping them in thousands)
18+
19+
920
.. v3.6.5:
1021
1122
3.6.5 (2021-01-27)

docs/api.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ CharmsEntry
544544
:members:
545545
:inherited-members:
546546

547+
DisplayFamiliar
548+
~~~~~~~~~~~~~~~
549+
.. autoclass:: DisplayFamiliar
550+
:members:
551+
:inherited-members:
552+
547553
DisplayItem
548554
~~~~~~~~~~~
549555
.. autoclass:: DisplayItem
@@ -562,6 +568,12 @@ DisplayOutfit
562568
:members:
563569
:inherited-members:
564570

571+
Familiars
572+
~~~~~~~~~
573+
.. autoclass:: Familiars
574+
:members:
575+
:inherited-members:
576+
565577
ItemSummary
566578
~~~~~~~~~~~
567579
.. autoclass:: ItemSummary

tests/resources/bazaar/tibiacom_auction_finished.txt

Lines changed: 23 additions & 1 deletion
Large diffs are not rendered by default.

tests/resources/bazaar/tibiacom_history.txt

Lines changed: 18 additions & 1 deletion
Large diffs are not rendered by default.

tests/tests_bazaar.py

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,28 +88,28 @@ def test_character_bazaar_from_content_history(self):
8888

8989
self.assertIsNotNone(bazaar)
9090
self.assertEqual(1, bazaar.page)
91-
self.assertEqual(777, bazaar.total_pages)
92-
self.assertEqual(19407, bazaar.results_count)
91+
self.assertEqual(1449, bazaar.total_pages)
92+
self.assertEqual(36219, bazaar.results_count)
9393
self.assertEqual(25, len(bazaar.entries))
9494
self.assertIsNotNone(bazaar.url)
9595

9696
auction = bazaar.entries[0]
97-
self.assertEqual(1060, auction.auction_id)
98-
self.assertEqual(752, auction.bid)
99-
self.assertEqual("Maroze Loth", auction.name)
100-
self.assertEqual(130, auction.level)
101-
self.assertEqual("Pyra", auction.world)
102-
self.assertEqual(Vocation.ELITE_KNIGHT, auction.vocation)
97+
self.assertEqual(325058, auction.auction_id)
98+
self.assertEqual(900, auction.bid)
99+
self.assertEqual("Rcrazy Illuminati", auction.name)
100+
self.assertEqual(255, auction.level)
101+
self.assertEqual("Celebra", auction.world)
102+
self.assertEqual(Vocation.MASTER_SORCERER, auction.vocation)
103103
self.assertEqual(Sex.MALE, auction.sex)
104104
self.assertEqual(BidType.WINNING, auction.bid_type)
105105
self.assertIsNotNone(auction.character_url)
106-
self.assertEqual(2, len(auction.displayed_items))
107-
self.assertEqual(128, auction.outfit.outfit_id)
106+
self.assertEqual(1, len(auction.displayed_items))
107+
self.assertEqual(143, auction.outfit.outfit_id)
108108

109109
first_item = auction.displayed_items[0]
110-
self.assertEqual(391, first_item.count)
111-
self.assertEqual(268, first_item.item_id)
112-
self.assertEqual("mana potion", first_item.name)
110+
self.assertEqual(1, first_item.count)
111+
self.assertEqual(25700, first_item.item_id)
112+
self.assertEqual("dream blossom staff", first_item.name)
113113
self.assertIsNotNone(first_item.image_url)
114114

115115
self.assertIsNone(bazaar.filters)
@@ -161,8 +161,8 @@ def test_auction_details_from_content_finished(self):
161161
self.assertIsInstance(auction.creation_date, datetime.datetime)
162162
self.assertEqual(26006721711, auction.experience)
163163
self.assertEqual(41893, auction.gold)
164-
self.assertEqual(540, auction.achievement_points)
165-
self.assertIsInstance(auction.regular_world_transfer_available_date, datetime.datetime)
164+
self.assertEqual(553, auction.achievement_points)
165+
self.assertIsNone(auction.regular_world_transfer_available_date)
166166
self.assertEqual(110, auction.available_charm_points)
167167
self.assertEqual(5800, auction.spent_charm_points)
168168

@@ -222,12 +222,20 @@ def test_auction_details_from_content_finished(self):
222222
self.assertEqual('Retro Warrior', auction.store_outfits.get_by_id(962).name)
223223
self.assertEqual(2, len(auction.store_outfits.search('retro')))
224224

225+
self.assertIsNotNone(auction.familiars)
226+
self.assertEqual(1, len(auction.familiars.entries))
227+
self.assertEqual(1, auction.familiars.total_pages)
228+
self.assertEqual(1, auction.familiars.results)
229+
self.assertEqual(992, auction.familiars.get_by_name("emberwing").familiar_id)
230+
self.assertEqual('Emberwing', auction.familiars.get_by_id(992).name)
231+
self.assertEqual(1, len(auction.familiars.search('ember')))
232+
225233
self.assertEqual(9, len(auction.blessings))
226234
self.assertEqual(18, len(auction.imbuements))
227235
self.assertEqual(8, len(auction.charms))
228236
self.assertEqual(0, len(auction.completed_cyclopedia_map_areas))
229237
self.assertEqual(16, len(auction.titles))
230-
self.assertEqual(214, len(auction.achievements))
238+
self.assertEqual(217, len(auction.achievements))
231239
self.assertEqual(509, len(auction.bestiary_progress))
232240
self.assertEqual(205, len(auction.completed_bestiary_entries))
233241

tibiapy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '3.6.5'
1+
__version__ = '3.7.0'
22
__author__ = 'Allan Galarza'
33

44
import logging

0 commit comments

Comments
 (0)