예제 #1
0
 def test_get_status_returns_expected_dto_l5(self, mock_matchmaking,
                                             mock_get_id):
     os.environ["LEVEL"] = "5"
     mock_matchmaking.return_value = {
         "level": "1",
         "url": "abc",
         "hashAlgo": "bcd",
         "scheme": "yup",
         "version": "1.2.3",
         "encryptionAlgo": "algo",
         "funded": True,
         "broadcastInterval": "1.23",
         "network": "net",
         "interchainWallet": "0xabc",
     }
     mock_get_id.return_value = "my_id"
     self.assertEqual(
         misc.get_v1_status(),
         {
             "id": "my_id",
             "level": 1,
             "url": "abc",
             "hashAlgo": "bcd",
             "scheme": "yup",
             "version": "1.2.3",
             "encryptionAlgo": "algo",
             "indexingEnabled": True,
             "funded": True,
             "broadcastInterval": 1.23,
             "network": "net",
             "interchainWallet": "0xabc",
         },
     )
     os.environ["LEVEL"] = "1"
예제 #2
0
 def test_get_status_returns_expected_dto_l1(self, mock_matchmaking,
                                             mock_get_id):
     mock_matchmaking.return_value = {
         "level": "1",
         "url": "abc",
         "hashAlgo": "bcd",
         "scheme": "yup",
         "version": "1.2.3",
         "encryptionAlgo": "algo"
     }
     mock_get_id.return_value = "my_id"
     self.assertEqual(
         misc.get_v1_status(),
         {
             "id": "my_id",
             "level": 1,
             "url": "abc",
             "hashAlgo": "bcd",
             "scheme": "yup",
             "version": "1.2.3",
             "encryptionAlgo": "algo",
             "indexingEnabled": True,
         },
     )
예제 #3
0
파일: misc.py 프로젝트: uningan/dragonchain
def get_status_v1(**kwargs) -> Tuple[str, int, Dict[str, str]]:
    """
    Return status data about a chain
    """
    return helpers.flask_http_response(200, misc.get_v1_status())
예제 #4
0
 def test_get_status_retrieves_matchmaking_data_and_id(
         self, mock_matchmaking, mock_get_id):
     misc.get_v1_status()
     mock_matchmaking.assert_called_once()
     mock_get_id.assert_called_once()