def test_itemBalances(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.balance.balanceOf(self.account) self.assertEqual(result['status'], 200) self.assertIsNotNone(result['data']) self.assertTrue(result['data'].isdigit())
def test_addItem(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.lootbox.addItem(self.apiKey, self.otpKey, self.itemAddress, self.rarity) self.assertEqual(result['status'], 200) self.assertTrue(type(result['data']) == dict)
def test_updateLootBoxCost(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.lootbox.updateLootBoxCost(self.apiKey, self.otpKey, "1") self.assertEqual(result['status'], 200) self.assertTrue(type(result['data']) == dict)
def test_getRecipe(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.crafter.getRecipe(self.itemAddress) self.assertEqual(result['status'], 200) self.assertTrue(type(result['data']) == list) self.assertIsNotNone(result['data'])
def test_getDeconstructables(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.crafter.getDeconstructables() self.assertEqual(result['status'], 200) self.assertTrue(type(result['data']) == list) self.assertIsNotNone(result['data'])
def test_newDestructionRecipe(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.crafter.newDestructionRecipe(self.apiKey, self.otpKey, '123456', ["1212", "3434"], [1, 2]) self.assertEqual(result['status'], 200)
# Import the library from lootsafe import LootSafe # Required Configurable Variables apiUrl = "http://localhost:1337/v1/" apiKey = "pWpzWuxoKUKAmlHc0wPi7lFS38FTth" # Creating and Initialzing the LootSafe Object lootsafe = LootSafe(apiUrl, apiKey) # Example of basic usage print() print("=== Example ===\n") print(lootsafe.crafter.getCraftables())
def test_fetchEvents(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.events.fetchEvents() self.assertEqual(result['status'], 200) self.assertTrue(type(result['data']) == list)
def test_getItems(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.lootbox.getItems(self.rarity) self.assertEqual(result['status'], 200) self.assertTrue(type(result['data']) == list)
def test_getCost(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.lootbox.getCost() self.assertEqual(result['status'], 200) self.assertTrue(result['data'].isdigit())
def test_removeRecipe(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.crafter.removeRecipe(self.apiKey, self.otpKey, self.itemAddress) self.assertEqual(result['status'], 200)
def test_newItem(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.general.newItem(self.apiKey, self.otpKey, "FNX45", "fnx45", 120000, "metadata") self.assertEqual(result['status'], 200)
def test_getTokenAddress(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.general.getTokenAddress() self.assertEqual(result['status'], 200) self.assertTrue(type(result['address']) == str)
def test_fetchEvents(self): lootsafe = LootSafe(self.apiUrl, self.apiKey) result = lootsafe.general.getMeta() self.assertEqual(result['connected'], True)