Skip to content

Commit

Permalink
split filename to name, path on Data obj
Browse files Browse the repository at this point in the history
  • Loading branch information
grizz committed Jan 2, 2018
1 parent b5f048d commit 5dce3ca
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1,347 deletions.
7 changes: 4 additions & 3 deletions pytest_filedata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ def loads(data):


class FileTestData(object):
def __init__(self, inp=None, exp=None, filename=None):
def __init__(self, inp=None, exp=None, name=None, path=None):
self.input = inp
self.expected = exp
self.filename = filename
self.name = name
self.path = path

def dumps(self, data):
return dumps(data)
Expand Down Expand Up @@ -89,7 +90,7 @@ def get_filedata(name):
continue

test_name, ext = os.path.splitext(fname)
data.setdefault(test_name, FileTestData(filename=each))
data.setdefault(test_name, FileTestData(name=test_name, path=dirname))

# could setattr
attr = ext[1:]
Expand Down
Loading

0 comments on commit 5dce3ca

Please sign in to comment.