Skip to content

Commit e4d599d

Browse files
committed
fixed microanalytic_score name
1 parent bbc5363 commit e4d599d

File tree

6 files changed

+37
-8
lines changed

6 files changed

+37
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Unreleased
33
----------
44
**Improvements**
55
- Added `update_module` and `delete_module` methods to MAS service.
6-
6+
7+
**Bugfixes**
8+
- Renamed `microanalytic_store` service to `microanalytic_score`
79

810
v1.0.1 (2019-07-31)
911
-------------------
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
sasctl.services.microanalytic\_store
1+
sasctl.services.microanalytic\_score
22
====================================
33

4-
.. automodule:: sasctl._services.microanalytic_store
4+
.. automodule:: sasctl._services.microanalytic_score
55
:members:
66
:undoc-members:
77
:show-inheritance:

doc/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ If not already present, these packages will be downloaded and install automatica
2929

3030
- requests
3131
- six
32+
- deprecated
3233

3334
The following additional packages are recommended for full functionality:
3435

@@ -388,6 +389,21 @@ All code submissions must meet the following requirements before the pull reques
388389

389390
.. _`numpydoc`: https://numpydoc.readthedocs.io/en/latest/format.html
390391

392+
393+
Useful tox commands
394+
++++++++++++
395+
flake8
396+
pytest
397+
398+
tox
399+
tox -e pyXX-flake8 # Linting/style checker
400+
tox -e pyXX-flake8 src/sasctl/...
401+
tox -e pyXX-tests
402+
tox -e pyXX-doc
403+
tox -e pyXX-tests -- python
404+
405+
406+
391407
.. _testing:
392408

393409
Testing

src/sasctl/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _instantiate(name):
1919
files = _instantiate('sasctl._services.files.Files')
2020
folders = _instantiate('sasctl._services.folders.Folders')
2121
microanalytic_score = _instantiate(
22-
'sasctl._services.microanalytic_store.MicroAnalyticScore')
22+
'sasctl._services.microanalytic_score.MicroAnalyticScore')
2323
model_management = _instantiate(
2424
'sasctl._services.model_management.ModelManagement')
2525
model_publish = _instantiate(

tests/unit/test_microanalytic_score.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
from sasctl.services import microanalytic_score as mas
1111

12-
def test_create_python_module():
12+
from sasctl import current_session
1313

14-
from sasctl import current_session
14+
with mock.patch('sasctl.core.requests.Session.request'):
15+
current_session('example.com', 'username', 'password')
1516

16-
with mock.patch('sasctl.core.requests.Session.request'):
17-
current_session('example.com', 'username', 'password')
1817

18+
def test_create_python_module():
1919
with mock.patch('sasctl.services.microanalytic_score.post') as post:
2020
with pytest.raises(ValueError):
2121
mas.create_module() # Source code is required
@@ -34,4 +34,15 @@ def test_create_python_module():
3434
assert 'public' == json['scope']
3535

3636

37+
def test_delete_module(caplog):
38+
import logging
39+
caplog.set_level(logging.INFO, 'sasctl._services.service')
40+
41+
# Delete should succeed even if object couldn't be found on server
42+
with mock.patch('sasctl._services.microanalytic_score.MicroAnalyticScore'
43+
'.get') as get:
44+
get.return_value = None
45+
46+
assert mas.delete_module('spam') is None
47+
assert any("Object 'spam' not found" in r.msg for r in caplog.records)
3748

0 commit comments

Comments
 (0)