Docker Community Forums

Share and learn in the Docker community.

Unable to run test script inside a Docker container, custom Error message : TypeError: 'NotImplementedType' object is not callable

I’m trying to dockerize a python -selenium based project where scripts uses custom class lib folders to run. When I try to run the script by providing all the required arguments (URL, Username, Password and browser parameters), I see a Type error as follows:

======================================================================
ERROR: test_log_in (main.LogInDscvr)

Traceback (most recent call last):
File “/app/uits/lib/SetUpTearDown.py”, line 129, in setUp
self.client = self.new_client(user_cfg=self.USER_CFG, browser_cfg=self.BROWSER_CFG)
File “/app/uits/lib/SetUpTearDown.py”, line 125, in new_client
return KeymasterClient.from_config(user_cfg=user_cfg, browser_cfg=browser_cfg)
File “/app/uits/lib/clients/dscvr.py”, line 31, in from_config
return cls(user_cfg=user_cfg, browser_cfg=browser_cfg, driver=driver)
File “/app/uits/lib/clients/dscvr.py”, line 14, in init
super(DscvrClient, self).init(params=user_cfg, config=browser_cfg, driver=driver)
File “/app/uits/lib/clients/selenium_client.py”, line 51, in init
raise NotImplemented(“don’t know where to save data”)
TypeError: ‘NotImplementedType’ object is not callable


Ran 1 test in 0.001s

FAILED (errors=1)

Please help me find a solution with what I’m doing wrong. The project structure looks like this:

Test script: dscvr_log_in_local
import unittest
from uits.lib.util_local import LocalTemplate, TestStep
from uits.lib.test_utils import TestUtils

Docker file:

FROM python:3.7

ENV APP_DIR /app
WORKDIR $APP_DIR
ENV PYTHONPATH ./app

# upgrade pip
RUN pip install --upgrade pip setuptools

COPY requirements.txt requirements.txt
COPY database database
COPY drivers drivers
COPY tests tests
COPY uits uits
COPY setup.py setup.py
COPY entrypoint.sh entrypoint.sh

#install required additional dependencies
RUN pip install -r requirements.txt

# install selenium
RUN pip install selenium

# set display port to avoid crash
ENV DISPLAY=:99

# install chromedriver
RUN apt-get install -yqq unzip
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE/chromedriver_linux64.zip
RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/

RUN chmod +x entrypoint.sh

#ENTRYPOINT [“bash”, “/app/entrypoint.sh”]