Updated more tests
parent
a14a3e1d31
commit
0e480ccebe
|
@ -228,9 +228,6 @@ class Commands:
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
loc_str = location.__str__()
|
loc_str = location.__str__()
|
||||||
except IntegrityError:
|
|
||||||
session.rollback()
|
|
||||||
raise EntryNameNotUniqueError
|
|
||||||
except DataError:
|
except DataError:
|
||||||
session.rollback()
|
session.rollback()
|
||||||
raise DatabaseValueError
|
raise DatabaseValueError
|
||||||
|
|
|
@ -220,8 +220,6 @@ class TestCommands(TestCase):
|
||||||
else:
|
else:
|
||||||
self.fail()
|
self.fail()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_edit_name(self):
|
def test_edit_name(self):
|
||||||
self.commands.register(zerohd, '143072699567177728')
|
self.commands.register(zerohd, '143072699567177728')
|
||||||
self.commands.add_shop(0, 0, shop_name='test shop', discord_uuid='143072699567177728')
|
self.commands.add_shop(0, 0, shop_name='test shop', discord_uuid='143072699567177728')
|
||||||
|
@ -255,6 +253,12 @@ class TestCommands(TestCase):
|
||||||
else:
|
else:
|
||||||
self.fail()
|
self.fail()
|
||||||
|
|
||||||
|
self.assertRaises(DatabaseValueError, self.commands.edit_pos, 9999999999999999999999999999999999999999999999999,
|
||||||
|
5, None, discord_uuid='143072699567177728')
|
||||||
|
|
||||||
|
self.assertRaises(LocationLookUpError, self.commands.edit_pos, 5, 5, 'henlo',
|
||||||
|
discord_uuid='143072699567177728')
|
||||||
|
|
||||||
self.commands.delete(name='test shop', discord_uuid='143072699567177728')
|
self.commands.delete(name='test shop', discord_uuid='143072699567177728')
|
||||||
|
|
||||||
self.assertRaises(NoLocationsInDatabase, self.commands.edit_pos, 5, 5, None,
|
self.assertRaises(NoLocationsInDatabase, self.commands.edit_pos, 5, 5, None,
|
||||||
|
@ -273,6 +277,15 @@ class TestCommands(TestCase):
|
||||||
else:
|
else:
|
||||||
self.fail()
|
self.fail()
|
||||||
|
|
||||||
|
self.commands.edit_tunnel("East", 500, 'test shop', discord_uuid='143072699567177728')
|
||||||
|
|
||||||
|
result = self.commands.info('test shop')
|
||||||
|
|
||||||
|
if "East" in result:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.fail()
|
||||||
|
|
||||||
def test_delete_item(self):
|
def test_delete_item(self):
|
||||||
self.commands.register(zerohd, '143072699567177728')
|
self.commands.register(zerohd, '143072699567177728')
|
||||||
self.commands.add_shop(0, 0, shop_name='test shop', discord_uuid='143072699567177728')
|
self.commands.add_shop(0, 0, shop_name='test shop', discord_uuid='143072699567177728')
|
||||||
|
@ -324,4 +337,14 @@ class TestCommands(TestCase):
|
||||||
self.commands.update_discord_uuid('143072699567177728', '0')
|
self.commands.update_discord_uuid('143072699567177728', '0')
|
||||||
|
|
||||||
self.assertRaises(PlayerNotFound, self.commands.add_shop, 0, 0, shop_name='test shop',
|
self.assertRaises(PlayerNotFound, self.commands.add_shop, 0, 0, shop_name='test shop',
|
||||||
discord_uuid='143072699567177728')
|
discord_uuid='143072699567177728')
|
||||||
|
|
||||||
|
def test_add_player(self):
|
||||||
|
self.commands.add_player('143072699567177728', zerohd)
|
||||||
|
|
||||||
|
self.assertRaises(PlayerInDBError, self.commands.add_player, '143072699567177728', zerohd)
|
||||||
|
|
||||||
|
if zerohd in self.commands.find_player('143072699567177728'):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.fail()
|
||||||
|
|
Loading…
Reference in New Issue