starting to write docs, taking decisions on public api
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
from mock import patch
|
||||
|
||||
from bonobo.ext.ods import extract_ods
|
||||
from bonobo.ext.opendatasoft import from_opendatasoft_api
|
||||
|
||||
|
||||
class ResponseMock:
|
||||
@ -17,7 +17,7 @@ class ResponseMock:
|
||||
|
||||
|
||||
def test_read_from_opendatasoft_api():
|
||||
extract = extract_ods('http://example.com/', 'test-a-set')
|
||||
extract = from_opendatasoft_api('http://example.com/', 'test-a-set')
|
||||
with patch(
|
||||
'requests.get', return_value=ResponseMock([
|
||||
{
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import pytest
|
||||
|
||||
from bonobo import to_json, Bag
|
||||
from bonobo import Bag, JsonFileWriter
|
||||
from bonobo.core.contexts import ComponentExecutionContext
|
||||
from bonobo.util.tokens import BEGIN, END
|
||||
|
||||
|
||||
def test_write_json_to_file(tmpdir):
|
||||
file = tmpdir.join('output.json')
|
||||
json_writer = to_json(str(file))
|
||||
json_writer = JsonFileWriter(str(file))
|
||||
context = ComponentExecutionContext(json_writer, None)
|
||||
|
||||
context.initialize()
|
||||
@ -28,7 +28,7 @@ def test_write_json_to_file(tmpdir):
|
||||
|
||||
def test_write_json_without_initializer_should_not_work(tmpdir):
|
||||
file = tmpdir.join('output.json')
|
||||
json_writer = to_json(str(file))
|
||||
json_writer = JsonFileWriter(str(file))
|
||||
|
||||
context = ComponentExecutionContext(json_writer, None)
|
||||
with pytest.raises(AttributeError):
|
||||
|
||||
Reference in New Issue
Block a user