|
@@ -19,7 +19,7 @@ def test_integration_stdin():
|
|
expected_result = yaml.load(expected_result_file.read())
|
|
expected_result = yaml.load(expected_result_file.read())
|
|
assert result == expected_result, 'unexpected result for ' + os.path.basename(mail_path)
|
|
assert result == expected_result, 'unexpected result for ' + os.path.basename(mail_path)
|
|
|
|
|
|
-def test_ingegration_path():
|
|
+def test_integration_path():
|
|
result = yaml.load(subprocess.check_output([
|
|
result = yaml.load(subprocess.check_output([
|
|
script_path,
|
|
script_path,
|
|
os.path.join(test_data_path, 'amazon', 'mail_1.eml'),
|
|
os.path.join(test_data_path, 'amazon', 'mail_1.eml'),
|
|
@@ -35,3 +35,18 @@ def test_ingegration_path():
|
|
with open(result_path) as yaml_file:
|
|
with open(result_path) as yaml_file:
|
|
expected_result += yaml.load(yaml_file.read())
|
|
expected_result += yaml.load(yaml_file.read())
|
|
assert result == expected_result
|
|
assert result == expected_result
|
|
|
|
+
|
|
|
|
+def test_catalogue(tmpdir):
|
|
|
|
+ os.chdir(tmpdir.strpath)
|
|
|
|
+ import shutil
|
|
|
|
+ shutil.copyfile(os.path.join(test_data_path, 'amazon', 'mail_8.eml'), 'mail.eml')
|
|
|
|
+ assert os.listdir('.') == ['mail.eml']
|
|
|
|
+ orders = yaml.load(subprocess.check_output([
|
|
|
|
+ script_path,
|
|
|
|
+ '--catalogue',
|
|
|
|
+ 'mail.eml',
|
|
|
|
+ ]))
|
|
|
|
+ assert os.listdir('.') == ['amazon.de']
|
|
|
|
+ assert os.listdir('amazon.de') == ['028-6176648-7157123', '028-0273468-3485109']
|
|
|
|
+ assert os.listdir(os.path.join('amazon.de', '028-6176648-7157123')) == ['mail.eml']
|
|
|
|
+ assert os.listdir(os.path.join('amazon.de', '028-0273468-3485109')) == ['mail.eml']
|