I have a Scheduler class and a test written for __generate_potential_weeks using unittest
main.py
class Scheduler:
def __init__(self, num_teams, num_weeks):
self.potential_weeks = self.__generate_potential_weeks(num_teams)
# Other stuff
def __generate_potential_weeks(self, num_teams):
# Does some things
test_scheduler.py
import unittest
from main import Scheduler
class SchedulerTestCase(unittest.TestCase):
def test_generate_weeks(self):
sch = Scheduler(4, 14)
weeks = sch.__generate_potential_weeks(4)
When I try to test __generate_potential_weeks, I get the following error
AttributeError: 'Scheduler' object has no attribute '_SchedulerTestCase__generate_potential_weeks'
Questions
- Why can't the test find
__generate_potential_weeks - How can I test
__generate_potential_weeks? It has some complex logic I would like to test separately fromScheduler