# Path: tibanna/awsem.py
# class AwsemRunJson(SerializableObject):
# class AwsemRunJsonJob(SerializableObject):
# class AwsemRunJsonLog(SerializableObject):
# class AwsemRunJsonApp(SerializableObject):
# class AwsemRunJsonInput(SerializableObject):
# class AwsemRunJsonInputFile(SerializableObject):
# class AwsemRunJsonOutput(SerializableObject):
# class AwsemPostRunJson(AwsemRunJson):
# class AwsemPostRunJsonJob(AwsemRunJsonJob):
# class AwsemPostRunJsonOutput(AwsemRunJsonOutput):
# class AwsemPostRunJsonOutputFile(SerializableObject):
#     def __init__(self, Job=None, config=None, strict=True):
#     def create_Job(self, Job, strict=True):
#     def __init__(self, App=None, Input=None, Output=None, JOBID='',
#                  start_time=None, Log=None, strict=True):
#     def create_Output(self, Output):
#     def update(self, **kwargs):
#     def start_time_as_datetime(self):
#     def __init__(self, log_bucket_directory=None):
#     def __init__(self, App_name=None, App_version=None, language=None,
#                  cwl_url=None, main_cwl=None, other_cwl_files=None,
#                  wdl_url=None, main_wdl=None, other_wdl_files=None, workflow_engine=None,
#                  container_image=None, command=None,
#                  snakemake_url=None, main_snakemake=None, other_snakemake_files=None):
#     def __init__(self, Input_files_data=None, Input_parameters=None, Secondary_files_data=None,
#                  # Input_files_reference is for older postrunjson
#                  # Env is missing in older postrunjson
#                  Input_files_reference=None, Env=None):
#     def as_dict_as_cwl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def as_dict_as_wdl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def check_input_files_key_compatibility(self, language):
#     def __init__(self, path, profile='', rename='', unzip='', mount=False, **kwargs):  # kwargs includes 'dir' and 'class'
#     def as_dict(self):
#     def as_dict_as_cwl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def as_dict_as_wdl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def __init__(self, output_bucket_directory=None, output_target=None,
#                  secondary_output_target=None, alt_cond_output_argnames=None):
#     def alt_output_target(self, argname_list):
#     def __init__(self, Job=None, config=None, commands=None,log=None, strict=True):
#     def add_commands(self, command):
#     def create_Job(self, Job, strict=True):
#     def __init__(self, App=None, Input=None, Output=None, JOBID='',
#                  start_time=None, end_time=None, status=None, Log=None,
#                  total_input_size=None, total_output_size=None, total_tmp_size=None,
#                  # older postrunjsons don't have these fields
#                  filesystem='', instance_id='', instance_availablity_zone='',
#                  Metrics=None, strict=True):
#     def create_Output(self, Output):
#     def end_time_as_datetime(self):
#     def add_filesystem(self, filesystem):
#     def __init__(self, output_bucket_directory=None, output_target=None,
#                  secondary_output_target=None, alt_cond_output_argnames=None,
#                  **kwargs):  # kwargs includes 'Output files'
#     def output_files(self):
#     def add_output_files(self, output_files):
#     def as_dict(self):
#     def __init__(self, path, target=None, basename=None, checksum=None,
#                  location=None, md5sum=None, size=None, secondaryFiles=None,
#                  **kwargs):  # kwargs includes 'class'
#     def add_target(self, target):
#     def as_dict(self):
# def file2cwlfile(filename, dirname, unzip):
# def file2wdlfile(filename, dirname, unzip):
# 
# Path: tibanna/exceptions.py
# class MalFormattedRunJsonException(Exception):
#     pass


import pytest
import copy
from tibanna import awsem
from tibanna.exceptions import MalFormattedRunJsonException
    assert hasattr(r, 'class_')
    assert hasattr(r, 'dir_')
    assert hasattr(r, 'path')
    assert hasattr(r, 'profile')
    assert hasattr(r, 'unzip')  # default '' if omitted
    assert r.class_ == 'File'
    assert r.dir_ == 'somebucket'
    assert r.path == 'somefilepath'
    assert r.profile == ''
    assert r.unzip == ''
    assert r.unzip == ''
    r_dict = r.as_dict()
    assert 'class' in r_dict
    assert 'dir' in r_dict
    assert 'path' in r_dict
    assert 'profile' in r_dict
    assert 'unzip' in r_dict
    assert 'unzip' in r_dict
    assert r_dict['class'] == 'File'
    assert r_dict['dir'] == 'somebucket'
    assert r_dict['path'] == 'somefilepath'
    assert r_dict['profile'] == ''
    assert r_dict['unzip'] == ''
    assert r_dict['unzip'] == ''


def test_AwsemRunJsonInputFile_rename_mount_error(run_json_inputfile):
    # rename and mount cannot be used together
    run_json_inputfile['rename'] = 'somerenamedpath'
    run_json_inputfile['mount'] = True

# Path: tibanna/awsem.py
# class AwsemRunJson(SerializableObject):
# class AwsemRunJsonJob(SerializableObject):
# class AwsemRunJsonLog(SerializableObject):
# class AwsemRunJsonApp(SerializableObject):
# class AwsemRunJsonInput(SerializableObject):
# class AwsemRunJsonInputFile(SerializableObject):
# class AwsemRunJsonOutput(SerializableObject):
# class AwsemPostRunJson(AwsemRunJson):
# class AwsemPostRunJsonJob(AwsemRunJsonJob):
# class AwsemPostRunJsonOutput(AwsemRunJsonOutput):
# class AwsemPostRunJsonOutputFile(SerializableObject):
#     def __init__(self, Job=None, config=None, strict=True):
#     def create_Job(self, Job, strict=True):
#     def __init__(self, App=None, Input=None, Output=None, JOBID='',
#                  start_time=None, Log=None, strict=True):
#     def create_Output(self, Output):
#     def update(self, **kwargs):
#     def start_time_as_datetime(self):
#     def __init__(self, log_bucket_directory=None):
#     def __init__(self, App_name=None, App_version=None, language=None,
#                  cwl_url=None, main_cwl=None, other_cwl_files=None,
#                  wdl_url=None, main_wdl=None, other_wdl_files=None, workflow_engine=None,
#                  container_image=None, command=None,
#                  snakemake_url=None, main_snakemake=None, other_snakemake_files=None):
#     def __init__(self, Input_files_data=None, Input_parameters=None, Secondary_files_data=None,
#                  # Input_files_reference is for older postrunjson
#                  # Env is missing in older postrunjson
#                  Input_files_reference=None, Env=None):
#     def as_dict_as_cwl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def as_dict_as_wdl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def check_input_files_key_compatibility(self, language):
#     def __init__(self, path, profile='', rename='', unzip='', mount=False, **kwargs):  # kwargs includes 'dir' and 'class'
#     def as_dict(self):
#     def as_dict_as_cwl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def as_dict_as_wdl_input(self, input_dir='', input_mount_dir_prefix=''):
#     def __init__(self, output_bucket_directory=None, output_target=None,
#                  secondary_output_target=None, alt_cond_output_argnames=None):
#     def alt_output_target(self, argname_list):
#     def __init__(self, Job=None, config=None, commands=None,log=None, strict=True):
#     def add_commands(self, command):
#     def create_Job(self, Job, strict=True):
#     def __init__(self, App=None, Input=None, Output=None, JOBID='',
#                  start_time=None, end_time=None, status=None, Log=None,
#                  total_input_size=None, total_output_size=None, total_tmp_size=None,
#                  # older postrunjsons don't have these fields
#                  filesystem='', instance_id='', instance_availablity_zone='',
#                  Metrics=None, strict=True):
#     def create_Output(self, Output):
#     def end_time_as_datetime(self):
#     def add_filesystem(self, filesystem):
#     def __init__(self, output_bucket_directory=None, output_target=None,
#                  secondary_output_target=None, alt_cond_output_argnames=None,
#                  **kwargs):  # kwargs includes 'Output files'
#     def output_files(self):
#     def add_output_files(self, output_files):
#     def as_dict(self):
#     def __init__(self, path, target=None, basename=None, checksum=None,
#                  location=None, md5sum=None, size=None, secondaryFiles=None,
#                  **kwargs):  # kwargs includes 'class'
#     def add_target(self, target):
#     def as_dict(self):
# def file2cwlfile(filename, dirname, unzip):
# def file2wdlfile(filename, dirname, unzip):
# 
# Path: tibanna/exceptions.py
# class MalFormattedRunJsonException(Exception):
#     pass


# Path: tests/tibanna/unicorn/test_awsem.py
import pytest
import copy
from tibanna import awsem
from tibanna.exceptions import MalFormattedRunJsonException

    assert hasattr(r, 'class_')
    assert hasattr(r, 'dir_')
    assert hasattr(r, 'path')
    assert hasattr(r, 'profile')
    assert hasattr(r, 'unzip')  # default '' if omitted
    assert r.class_ == 'File'
    assert r.dir_ == 'somebucket'
    assert r.path == 'somefilepath'
    assert r.profile == ''
    assert r.unzip == ''
    assert r.unzip == ''
    r_dict = r.as_dict()
    assert 'class' in r_dict
    assert 'dir' in r_dict
    assert 'path' in r_dict
    assert 'profile' in r_dict
    assert 'unzip' in r_dict
    assert 'unzip' in r_dict
    assert r_dict['class'] == 'File'
    assert r_dict['dir'] == 'somebucket'
    assert r_dict['path'] == 'somefilepath'
    assert r_dict['profile'] == ''
    assert r_dict['unzip'] == ''
    assert r_dict['unzip'] == ''


def test_AwsemRunJsonInputFile_rename_mount_error(run_json_inputfile):
    # rename and mount cannot be used together
    run_json_inputfile['rename'] = 'somerenamedpath'
    run_json_inputfile['mount'] = True

    with pytest.raises(MalFormattedRunJsonException) as ex: