def test_RetrieveGameWithSlash(self): ''' Validate items with genre e.g. Action/Adventure are handled ''' genres = Genre(self.gdb).getGenresForGame(179) self.assertTrue( genres == 'Racing / Driving, Role-Playing (RPG)', 'Game with slash in genre not handled correctly (was {0})'.format( genres))
def test_RetrieveMultipleGenresByGameId(self): ''' Test that games with multiple genres are comma-separated strings FIXME TODO Order of genres ''' genres = Genre(self.gdb).getGenresForGame(50) print genres self.assertTrue( genres == 'Adventure, Action, Role-Playing', 'Expected multiple genres for game to be comma-separated string, was {0}' .format(genres))
def test_FilterGenres_Region(self): rows = Genre(self.gdb).getFilteredGenres(0, 0, 0, 0, 0, 0, 'USA', '0 = 0') self.assertEquals(len(rows), 7)
def test_FilterGenres_Rating(self): rows = Genre(self.gdb).getFilteredGenres(0, 0, 0, 0, 0, 5, 0, '0 = 0') self.assertEquals(len(rows), 5)
def test_FilterGenres_MaxPlayers(self): rows = Genre(self.gdb).getFilteredGenres(0, 0, 0, 0, '2', 0, 0, '0 = 0') self.assertEquals(len(rows), 7)
def test_FilterGenres_Developer(self): rows = Genre(self.gdb).getFilteredGenres(0, 0, 0, 1, 0, 0, 0, '0 = 0') self.assertEquals(len(rows), 4)
def test_FilterGenres_Publisher(self): rows = Genre(self.gdb).getFilteredGenres(0, 0, 3, 0, 0, 0, 0, '0 = 0') self.assertEquals(len(rows), 1)
def test_FilterGenres_Year(self): rows = Genre(self.gdb).getFilteredGenres(0, 2, 0, 0, 0, 0, 0, '0 = 0') self.assertEquals(len(rows), 2)
def test_FilterGenres_RomCollection(self): rows = Genre(self.gdb).getFilteredGenres(1, 0, 0, 0, 0, 0, 0, '0 = 0') self.assertEquals(len(rows), 7)
def test_RetrieveSingleGenreByGameId(self): ''' Validate basic retrieve works ''' genre = Genre(self.gdb).getGenresForGame(28) self.assertTrue(genre == 'Role-Playing', 'Genre for game id 28 expected to be Role-Playing')