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"
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, }, )
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())
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()