X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Ftest_store.py;h=ffd264555f9116ac09e9e94b31cb64e0cf8fd476;hb=3080f31d1ee74104640dcff451922cd0ae88ee22;hp=4232fc3efa1b70c2dbd30aecc135b2fd86aaa7b1;hpb=c5a3b4e8c00f8d7bb54b342b1dd43c08bbfbd4db;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/tests/test_store.py b/tests/test_store.py index 4232fc3..ffd2645 100644 --- a/tests/test_store.py +++ b/tests/test_store.py @@ -4,12 +4,14 @@ import datetime import threading import market, portfolio, store +@unittest.skipUnless("unit" in limits, "Unit skipped") class NoopLockTest(unittest.TestCase): def test_with(self): noop_lock = store.NoopLock() with noop_lock: self.assertTrue(True) +@unittest.skipUnless("unit" in limits, "Unit skipped") class LockedVarTest(unittest.TestCase): def test_values(self): @@ -61,6 +63,7 @@ class LockedVarTest(unittest.TestCase): thread3.join() self.assertEqual("Bar", locked_var.get()[0:3]) +@unittest.skipUnless("unit" in limits, "Unit skipped") class TradeStoreTest(WebMockTestCase): def test_compute_trades(self): self.m.balances.currencies.return_value = ["XMR", "DASH", "XVG", "BTC", "ETH"] @@ -285,6 +288,7 @@ class TradeStoreTest(WebMockTestCase): self.assertEqual([trade_mock1, trade_mock2], trade_store.pending) +@unittest.skipUnless("unit" in limits, "Unit skipped") class BalanceStoreTest(WebMockTestCase): def setUp(self): super().setUp() @@ -437,6 +441,7 @@ class BalanceStoreTest(WebMockTestCase): self.assertEqual(1, as_json["BTC"]) self.assertEqual(2, as_json["ETH"]) +@unittest.skipUnless("unit" in limits, "Unit skipped") class ReportStoreTest(WebMockTestCase): def test_add_log(self): with self.subTest(market=self.m): @@ -830,6 +835,7 @@ class ReportStoreTest(WebMockTestCase): response = mock.Mock() response.status_code = 200 response.text = "Hey" + response.elapsed.total_seconds.return_value = 120 report_store.log_http_request("method", "url", "body", "headers", response) @@ -840,6 +846,7 @@ class ReportStoreTest(WebMockTestCase): 'body': 'body', 'headers': 'headers', 'status': 200, + 'duration': 120, 'response': 'Hey', 'response_same_as': None, }) @@ -995,6 +1002,7 @@ class ReportStoreTest(WebMockTestCase): 'action': 'Hey' }) +@unittest.skipUnless("unit" in limits, "Unit skipped") class PortfolioTest(WebMockTestCase): def setUp(self): super().setUp()