]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/blobdiff - tests/test_store.py
Move acceptance tests to common directory
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git] / tests / test_store.py
index 4232fc3efa1b70c2dbd30aecc135b2fd86aaa7b1..ffd264555f9116ac09e9e94b31cb64e0cf8fd476 100644 (file)
@@ -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()