diff --git a/kittengroomer/helpers.py b/kittengroomer/helpers.py index 1e24140..3455bbd 100644 --- a/kittengroomer/helpers.py +++ b/kittengroomer/helpers.py @@ -165,9 +165,9 @@ class FileBase(object): self.dst_path + "\", type '" + ext + "': File exists.") else: - # TODO: Uncomment these after object relationships are fixed - # dst_dir_path, filename = os.path.split(self.dst_path) - # self._safe_mkdir(dst_dir_path) + dst_dir_path, filename = os.path.split(self.dst_path) + if not os.path.exists(dst_dir_path): + os.makedirs(dst_dir_path) # TODO: Check extension for leading "." self.metadata_file_path = self.dst_path + ext return self.metadata_file_path diff --git a/tests/src_valid/Example.jpg b/tests/src_valid/Example.jpg new file mode 100644 index 0000000..a686d10 Binary files /dev/null and b/tests/src_valid/Example.jpg differ diff --git a/tests/testfile_catalog.md b/tests/testfile_catalog.md new file mode 100644 index 0000000..692daf8 --- /dev/null +++ b/tests/testfile_catalog.md @@ -0,0 +1,12 @@ +src_invalid +=========== + +- + + + +src_valid +========= + +- Example.jpg: image/jpeg, obtained from wikipedia.org +- blah.conf: text file with a .conf extension \ No newline at end of file