def test_container():
    format_aware = Mock()
    format_aware.supported_format.return_value = 'abc'

    container = FileFormatAwareContainer()
    assert not container.is_format_supported('abc')
    container.register(format_aware)
    format_aware.supported_format.assert_called_once_with()
    assert container.is_format_supported('abc')
    assert container.get('abc') == format_aware
def test_container():
    format_aware = Mock()
    format_aware.supported_format.return_value = 'abc'

    container = FileFormatAwareContainer()
    assert not container.is_format_supported('abc')
    container.register(format_aware)
    format_aware.supported_format.assert_called_once_with()
    assert container.is_format_supported('abc')
    assert container.get('abc') == format_aware
from lib.file_format_aware_container import FileFormatAwareContainer
from writers.json_output_writer import JSONOutputWriter
from writers.txt_output_writer import TXTOutputWriter
from writers.csv_output_writer import CSVOutputWriter
from writers.xml_output_writer import XMLOutputWriter


writer_container = FileFormatAwareContainer()

writer_container.register(JSONOutputWriter())
writer_container.register(TXTOutputWriter())
writer_container.register(CSVOutputWriter())
writer_container.register(XMLOutputWriter())
Esempio n. 4
0
from lib.file_format_aware_container import FileFormatAwareContainer
from readers.json_input_reader import JsonInputReader
from readers.csv_input_reader import CSVInputReader
from readers.txt_input_reader import TXTInputReader
from readers.xml_input_reader import XMLInputReader

__author__ = 'Hossein Zolfi <*****@*****.**>'

reader_container = FileFormatAwareContainer()
reader_container.register(JsonInputReader())
reader_container.register(CSVInputReader())
reader_container.register(TXTInputReader())
reader_container.register(XMLInputReader())
Esempio n. 5
0
from lib.file_format_aware_container import FileFormatAwareContainer
from writers.json_output_writer import JSONOutputWriter
from writers.txt_output_writer import TXTOutputWriter
from writers.csv_output_writer import CSVOutputWriter
from writers.xml_output_writer import XMLOutputWriter

writer_container = FileFormatAwareContainer()

writer_container.register(JSONOutputWriter())
writer_container.register(TXTOutputWriter())
writer_container.register(CSVOutputWriter())
writer_container.register(XMLOutputWriter())
from lib.file_format_aware_container import FileFormatAwareContainer
from readers.json_input_reader import JsonInputReader
from readers.csv_input_reader import CSVInputReader
from readers.txt_input_reader import TXTInputReader
from readers.xml_input_reader import XMLInputReader

__author__ = 'Hossein Zolfi <*****@*****.**>'


reader_container = FileFormatAwareContainer()
reader_container.register(JsonInputReader())
reader_container.register(CSVInputReader())
reader_container.register(TXTInputReader())
reader_container.register(XMLInputReader())