forked from woctezuma/steam-market
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
118 lines (82 loc) · 3.14 KB
/
tests.py
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
import unittest
import batch_create_packs
import creation_time_utils
import drop_rate_estimates
import market_arbitrage
import market_listing
import market_order
import market_search
import market_utils
import parsing_utils
import sack_of_gems
import transaction_fee
import utils
class TestMarketListingMethods(unittest.TestCase):
def test_get_listing_details_batch(self):
listing_hashes = [
"407420-Gabe Newell Simulator Booster Pack",
"443380-Tokyo Babel Booster Pack",
"15700-Oddworld: Abe's Oddysee Booster Pack",
]
all_listing_details = market_listing.get_listing_details_batch(
listing_hashes,
save_to_disk=False,
)
self.assertEqual(len(all_listing_details), len(listing_hashes))
def test_main(self):
self.assertTrue(market_listing.main())
class TestParsingUtilsMethods(unittest.TestCase):
def test_main(self):
self.assertTrue(parsing_utils.main())
class TestCreationTimeUtilsMethods(unittest.TestCase):
def test_main(self):
self.assertTrue(creation_time_utils.main())
class TestSackOfGemsMethods(unittest.TestCase):
def test_download_sack_of_gems_price(self):
sack_of_gems_price = sack_of_gems.download_sack_of_gems_price()
self.assertGreater(sack_of_gems_price, 0)
def test_load_sack_of_gems_price(self):
sack_of_gems_price = sack_of_gems.load_sack_of_gems_price()
self.assertGreater(sack_of_gems_price, 0)
class TestMarketSearchMethods(unittest.TestCase):
def test_download_all_listings(self):
self.assertTrue(market_search.download_all_listings())
class TestMarketUtilsMethods(unittest.TestCase):
def test_load_aggregated_badge_data(self):
aggregated_badge_data = market_utils.load_aggregated_badge_data()
self.assertGreater(len(aggregated_badge_data), 0)
class TestMarketArbitrageMethods(unittest.TestCase):
def test_apply_workflow(self):
try:
flag = market_arbitrage.apply_workflow(
retrieve_listings_from_scratch=False,
retrieve_market_orders_online=False,
)
except KeyError:
# The steamLoginSecure cookie cannot be made public for the test.
flag = True
self.assertTrue(
flag,
)
class TestMarketOrderMethods(unittest.TestCase):
def test_main(self):
try:
flag = market_order.main()
except KeyError:
# The steamLoginSecure cookie cannot be made public for the test.
flag = True
self.assertTrue(flag)
class TestUtilsMethods(unittest.TestCase):
def test_main(self):
self.assertTrue(utils.main())
class TestTransactionFeeMethods(unittest.TestCase):
def test_main(self):
self.assertTrue(transaction_fee.main())
class TestBatchCreatePacksMethods(unittest.TestCase):
def test_main(self):
self.assertTrue(batch_create_packs.main(is_a_simulation=True))
class TestDropRateEstimatesMethods(unittest.TestCase):
def test_main(self):
self.assertTrue(drop_rate_estimates.main())
if __name__ == '__main__':
unittest.main()