Jun-25-2022, 04:44 AM
My program has the following structure:
At the moment this is the dummy test I'm trying to make work:
Program ├── src ├── <classes> ├── test ├── <myTests>I'm trying to use unittest to make tests for the classes inside my src folder. I'm having so many problems, relative imports problems, a "ModuleNotFoundError: No module named 'test.unit' ", running 0 of all my tests like they don't exist.
At the moment this is the dummy test I'm trying to make work:
#unit.py #built-in imports import unittest #local classes from ..src.components.Containers.ContainerEmployees import ContainerEmployees class ContainerEmployeesTest(unittest.TestCase): def TestPass(self): containerEmployees = ContainerEmployees() print(containerEmployees) self.assertEqual(1,1) def TestFails(self): self.assertEqual(1,2)I'm completely lost, please someone tell how would you do this? how would you import them into your tests? and then how would you execute those tests? Please I need an example of this