Example #1
0
def temp_fn_08():
    """pre-existing module file with force clean"""

    module_output_file_name = _create_temp_file_name()

    early_properties = {'skunk': 'stinks', 'raccoon': 'cleans food'}
    early_module = Module(id=helper.module_id,
                          properties=early_properties,
                          artifacts=(helper.bdist_artifact, ),
                          dependencies=(helper.colorama_dependency, ))
    _write_module_file(early_module, module_output_file_name)

    #conditions prepared, now perform action under test and assert results
    _execute(
        module_id=helper.module_id,
        dist_files_tuple_array=[
            ('sdist', None, helper.sdist_file),
            #        ('bdist', None, bdist_file),
            ('bdist_egg', None, helper.egg_file)
        ],
        freeze_file=helper.full_requirements_file,
        module_file=module_output_file_name,
        force_dependency_rebuild=False,
        force_clean=True,
        expected_module_properties=helper.module_properties,
        expected_artifacts=(helper.sdist_artifact, helper.egg_artifact),
        expected_dependencies=(helper.colorama_dependency,
                               helper.mock_dependency, helper.nose_dependency))
    os.unlink(module_output_file_name)
Example #2
0
def temp_fn_07():
    """pre-existing module file with non-matching module id"""

    module_output_file_name = _create_temp_file_name()

    early_properties = {'skunk': 'stinks', 'raccoon': 'cleans food'}
    early_module = Module(id=helper.alternate_module_id,
                          properties=early_properties,
                          artifacts=(helper.bdist_artifact, ),
                          dependencies=(helper.colorama_dependency, ))
    _write_module_file(early_module, module_output_file_name)

    exception_caught = False

    #conditions prepared, now perform action under test and assert results
    try:
        _execute(
            module_id=helper.module_id,
            dist_files_tuple_array=[
                ('sdist', None, helper.sdist_file),
                #        ('bdist', None, bdist_file),
                ('bdist_egg', None, helper.egg_file)
            ],
            freeze_file=helper.full_requirements_file,
            module_file=module_output_file_name,
            force_dependency_rebuild=False,
            force_clean=False,
            expected_module_properties=early_properties,
            expected_artifacts=(helper.bdist_artifact, helper.sdist_artifact,
                                helper.egg_artifact),
            expected_dependencies=(helper.colorama_dependency, ))
    except ValueError:
        exception_caught = True

    assert exception_caught, "Expect ValueError to be encountered"
    os.unlink(module_output_file_name)