Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Habush committed Feb 27, 2019
1 parent a114e2a commit d058a03
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ RUN mkdir $HOME/datasets
ENV CODE $HOME/mozi_snet_service
RUN mkdir $CODE

RUN wget -O grpc-proxy https://github.com/improbable-eng/grpc-web/releases/download/0.6.3/grpcwebproxy-0.6.3-linux-x86_64
RUN chmod 755 grpc-proxy

COPY requirements.txt $CODE/requirements.txt
WORKDIR $CODE
RUN pip install -r requirements.txt

COPY . $CODE

RUN wget -O grpc-proxy https://github.com/improbable-eng/grpc-web/releases/download/0.6.3/grpcwebproxy-0.6.3-linux-x86_64
RUN chmod 755 grpc-proxy
RUN chmod 755 build.sh && ./build.sh

RUN chmod 755 build.sh && ./build.sh
2 changes: 1 addition & 1 deletion service_metadata.ropsten.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
],
"service_description": {
"url": "https://mozi-ai.github.io/moses-service/",
"description": "The service uses the OpenCog meta optimising semantic evolutionary search algorithm MOSES to generate a supervised binary classification model of genomic or other high dimensional binary feature data sets using boolean regression"
"description": "The service uses the OpenCog meta optimising semantic evolutionary search algorithm MOSES to generate a supervised binary classification model of genomic or other high dimensional binary feature data sets using evolutionary methods"
}
}
2 changes: 1 addition & 1 deletion snetd_configs/snetd.kovan.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"daemon_end_point": "https://mozi.ai/moses-service",
"daemon_end_point": "0.0.0.0:5002",
"ethereum_json_rpc_endpoint": "https://kovan.infura.io",
"ipfs_end_point": "http://ipfs.singularitynet.io:80",
"registry_address_key": "0xe331bf20044a5b24c1a744abc90c1fd711d2c08d",
Expand Down
10 changes: 6 additions & 4 deletions tests/test_start_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def setUp(self):

@patch("pymongo.MongoClient")
@patch("task.task_runner.CrossValidation")
def test_start_analysis(self, cross_val, client):
@patch("task.task_runner.write_dataset")
def test_start_analysis(self, write_dataset, cross_val, client):
mock_db = mongomock.MongoClient().db
client().__getitem__.return_value = mock_db
session = {
Expand All @@ -37,8 +38,8 @@ def test_start_analysis(self, cross_val, client):
"filter_opts": {"score": "precision", "value": 0.4}
}

mock_db.sessions.insert_one(session)
cross_val.return_value.run_folds.return_value = "Run folds"
write_dataset.return_value = ("", "")

start_analysis.delay(**session)

Expand All @@ -48,7 +49,8 @@ def test_start_analysis(self, cross_val, client):

@patch("pymongo.MongoClient")
@patch("task.task_runner.CrossValidation")
def test_start_analysis_error_path(self, cross_val, client):
@patch("task.task_runner.write_dataset")
def test_start_analysis_error_path(self, write_dataset, cross_val, client):
mock_db = mongomock.MongoClient().db
client().__getitem__.return_value = mock_db
session = {
Expand All @@ -57,8 +59,8 @@ def test_start_analysis_error_path(self, cross_val, client):
"filter_opts": {"score": "precision", "value": 0.4}
}

mock_db.sessions.insert_one(session)
cross_val.side_effect = Exception("Mock exception")
write_dataset.return_value = ("", "")

self.assertRaises(Exception, start_analysis.delay(**session))

Expand Down

0 comments on commit d058a03

Please sign in to comment.