Joe91 / fun-bots

A highly customizable and configurable bot mod for your Venice Unleashed Battlefield 3 server.
https://discord.gg/zNk3qCzk6x
237 stars 45 forks source link

feat: test files #246

Closed joao-vitor-souza closed 1 year ago

joao-vitor-souza commented 1 year ago

0380c4e and 002cdbc: Create the tests/ folder for the tools/ scripts. Eventually, this will be used to automate tests for all tools, therefore, eliminating the necessity of manual testing. Any new change in tools/ scripts will now be automatically tested running pytest in tests/ folder. c7230dc: Add the __init__.py to all folders of fun-bots-helper. This tells the Python interpreter to treat all folders as Python modules, eliminating the necessity of using sys.path.insert(1, "../") to move to a folder up.

Once merged it, I'll commit new tests directly to dev branch.

joao-vitor-souza commented 1 year ago

Also, I had to remove cursor.execute("vacuum") because this was droping the sqlite_sequence table after reconstructing the database, since sqlite_sequence was totally cleaned after running clear_all_paths.py.

Joe91 commented 1 year ago

This really is an amazing development. I used the vakuum to reduce the size of the database. But I'm fine with that. It depends on you if you want to add more tests. Since it's mostly a dev-tool it does not need to be tested in extrem depth, but having this is amazing:-)...

joao-vitor-souza commented 1 year ago

This really is an amazing development. I used the vakuum to reduce the size of the database. But I'm fine with that. It depends on you if you want to add more tests. Since it's mostly a dev-tool it does not need to be tested in extrem depth, but having this is amazing:-)...

Yep, the tests will mostly check if the functions are doing their main task. No need to do more than that for now.

I don't know if an empty sqlite_sequence table is useful for something, maybe I'll use vacuum again and adapt the test_clear_all_paths.py to it by removing sqlite_sequence table from remaining_tables. Do you remember if sqlite_sequence is used somewhere else? I don't think so.

Joe91 commented 1 year ago

Have to check that. But it should be easy to test if everything works still fine. I don't think it's needed to vacuum the files. With the button you only want to remove unwanted tables from the database. No need to shrink the size at all since it will be filled sooner or later anyways...

Joe91 commented 1 year ago

I'm totally open for all proposals :-) . Just go for it if you like! Another questin: Do you also use discord? That would simplify the communication a little. We have our own fun-bots-discord-server with some dev-channels...

joao-vitor-souza commented 1 year ago

I'm totally open for all proposals :-) . Just go for it if you like! Another questin: Do you also use discord? That would simplify the communication a little. We have our own fun-bots-discord-server with some dev-channels...

I just entered in the server. I'm joao-vitor-souza