Skip to content

Commit

Permalink
Fixing unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-silva-funttastic committed Oct 26, 2023
1 parent bb74caf commit b935385
Showing 1 changed file with 6 additions and 12 deletions.
Expand Up @@ -708,15 +708,9 @@ def test_order_sides(self):

def test_order_types(self):
for item in KujiraOrderType:
if item != KujiraOrderType.MARKET:
hummingbot_type = KujiraOrderType.to_hummingbot(item)
kujira_type = KujiraOrderType.from_hummingbot(hummingbot_type)
kujira_type_from_name = KujiraOrderType.from_name(kujira_type.name)

self.assertEqual(item, kujira_type)
self.assertEqual(item, kujira_type_from_name)
else:
with self.assertRaises(ValueError) as context:
KujiraOrderType.to_hummingbot(item)

self.assertEqual(str(context.exception), 'Unrecognized order type "OrderType.MARKET".')
hummingbot_type = KujiraOrderType.to_hummingbot(item)
kujira_type = KujiraOrderType.from_hummingbot(hummingbot_type)
kujira_type_from_name = KujiraOrderType.from_name(kujira_type.name)

self.assertEqual(item, kujira_type)
self.assertEqual(item, kujira_type_from_name)

0 comments on commit b935385

Please sign in to comment.