Exemplo n.º 1
0
    def initialize(self, path, fwparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        if not fwparams.get('fieldwidths'):
            raise AttributeError
        self.fwparams = fwparams
        self.headers = headers
Exemplo n.º 2
0
    def initialize(self, path, fwparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        if not fwparams.get('fieldwidths'):
            raise AttributeError
        self.fwparams = fwparams
        self.headers = headers
Exemplo n.º 3
0
    def initialize(self, path, csvparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        self.csvparams = {} if not csvparams else csvparams
        self.headers = headers
Exemplo n.º 4
0
def test_initialize_file(csv_with_headers):
    path = csv_with_headers
    assert textfile.initialize_file(path) == (path, {})
    with pytest.raises(IOError):
        textfile.initialize_file('does_not_exist')
Exemplo n.º 5
0
    def initialize(self, path, csvparams, headers, fileparams):

        self.path, self.fileparams = textfile.initialize_file(path, fileparams)
        self.csvparams = {} if not csvparams else csvparams
        self.headers = headers