mathew-kurian / GameDB

Visual GameDB dubbed "4PlayDB" :)
1 stars 2 forks source link

Add Unit Tests for models.py #33

Closed mathew-kurian closed 8 years ago

mathew-kurian commented 8 years ago

You will need to install MySQL -u root -p 123456

Migrate data into your db https://github.com/bluejamesbond/cs373-idb/blob/master/migrate.py

Add test cases in this file: https://github.com/bluejamesbond/cs373-idb/blob/master/tests.py

    def test_game_1(self):
        entity = to_dict(self.session.query(Game).get(29935))  # you don't need to convert to_dict
        self.assertEqual(entity['name'], "Mass Effect 3") # `entity.name` should do the trick
mathew-kurian commented 8 years ago

@RR-1995 Can you help matt out?

RR-1995 commented 8 years ago

I'll get to it after finishing the UML

mathew-kurian commented 8 years ago

@RR-1995 @MatthewKimUT Here is the install script. I highly suggest you use a Linux machine or VM (VM would be best) https://github.com/bluejamesbond/cs373-idb/blob/master/scripts/setup/install.sh (school machines have limitations btw)

RR-1995 commented 8 years ago

how many tests do we need?

mathew-kurian commented 8 years ago

i would say like 3 per table. shouldn't be hard at all

RR-1995 commented 8 years ago

got it

mathew-kurian commented 8 years ago

The last line of the script should be

pm2 start -i 0 -x --interpreter python3 index.py -p 5000
RR-1995 commented 8 years ago

I'll do the tests for game and company.

RR-1995 commented 8 years ago

is there no company-platform table?

RR-1995 commented 8 years ago

i don't see one in mysql

mathew-kurian commented 8 years ago

companyplatform is a hybrid view (materialized on use)

RR-1995 commented 8 years ago

i think we're done here