Updated more tests

doc_update
Joey Hines 2018-09-21 19:58:56 -05:00
parent a14a3e1d31
commit 0e480ccebe
2 changed files with 26 additions and 6 deletions

View File

@ -228,9 +228,6 @@ class Commands:
session.commit()
loc_str = location.__str__()
except IntegrityError:
session.rollback()
raise EntryNameNotUniqueError
except DataError:
session.rollback()
raise DatabaseValueError

View File

@ -220,8 +220,6 @@ class TestCommands(TestCase):
else:
self.fail()
def test_edit_name(self):
self.commands.register(zerohd, '143072699567177728')
self.commands.add_shop(0, 0, shop_name='test shop', discord_uuid='143072699567177728')
@ -255,6 +253,12 @@ class TestCommands(TestCase):
else:
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.assertRaises(NoLocationsInDatabase, self.commands.edit_pos, 5, 5, None,
@ -273,6 +277,15 @@ class TestCommands(TestCase):
else:
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):
self.commands.register(zerohd, '143072699567177728')
self.commands.add_shop(0, 0, shop_name='test shop', discord_uuid='143072699567177728')
@ -325,3 +338,13 @@ class TestCommands(TestCase):
self.assertRaises(PlayerNotFound, self.commands.add_shop, 0, 0, shop_name='test shop',
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()