def invoking_the_listing_command_returns_only_invalid_templates():
    command.handle('invalid')
    expected = abs(settings.ROOT_DIR, 'dummy_app1/templates/invalid_template.html')

    not_expected = abs(settings.ROOT_DIR, 'dummy_app1/templates/base_app1.html')

    assert expected in sys.stdout.outputs, 'should have an invalid template'
    assert not_expected not in sys.stdout.outputs, "shouldn't list valid templates"
def invoking_the_listing_command_returns_only_invalid_templates():
    command.handle('invalid')
    expected = "\033[0;31m%s" % \
            abs(settings.ROOT_DIR, 'dummy_app1/templates\033[1;31m/invalid_template.html')

    not_expected = "\033[0;32m%s" %\
            abs(settings.ROOT_DIR, 'dummy_app1/templates/base_app1.html')

    assert expected in sys.stdout.outputs, 'should have an invalid template'
    assert not_expected not in sys.stdout.outputs, "shouldn't list valid templates"
def invoking_the_listing_command_returns_all_paths():
    command.handle("dirs")
    expected = "".join(["\033[0;34m", abs(settings.ROOT_DIR, "templates")])
    assert expected in sys.stdout.outputs, "Should return a list of paths"
def i_have_an_invalid_template():
    command.handle('list')
    expected = abs(settings.ROOT_DIR, 'dummy_app1/templates/invalid_template.html')
    assert expected in sys.stdout.outputs, 'should have an invalid template'
def invoking_the_listing_command_returns_all_templates():
    command.handle('list')
    expected = abs(settings.ROOT_DIR, 'dummy_app1/templates/base_app1.html')
    assert expected in sys.stdout.outputs, '"%s" expected in "%s"' \
            % (expected, sys.stdout.outputs)
def invoking_the_listing_command_returns_all_templates():
    command.handle('list')
    expected = "\033[0;32m%s" %\
            abs(settings.ROOT_DIR, 'dummy_app1/templates\033[1;32m/base_app1.html')
    assert expected in sys.stdout.outputs, 'return a list of templates'
def invoking_the_listing_command_returns_all_paths():
    command.handle('dirs')
    expected = abs(settings.ROOT_DIR, 'templates')
    assert expected in sys.stdout.outputs,\
            'Should return a list of paths'
def invoking_the_listing_command_returns_all_paths():
    command.handle('dirs')
    expected = ''.join(['\033[0;34m', abs(settings.ROOT_DIR, 'templates')])
    assert expected in sys.stdout.outputs,\
            'Should return a list of paths'
def i_have_an_invalid_template():
    command.handle('list')
    expected = "\033[0;31m%s" %\
            abs(settings.ROOT_DIR, 'dummy_app1/templates\033[1;31m/invalid_template.html')
    assert expected in sys.stdout.outputs, 'should have an invalid template'
def invoking_the_listing_command_returns_all_templates():
    command.handle('list')
    expected = "\033[0;32m%s" %\
            abs(settings.ROOT_DIR, 'dummy_app1/templates\033[1;32m/base_app1.html')
    assert expected in sys.stdout.outputs, 'return a list of templates'
def test_i_have_installed_apps_template_folders_on_my_path():
    assert abs(settings.ROOT_DIR, 'dummy_app1/templates'
               ) in paths, 'should have the template folder for DUMMY_APP1'
    assert abs(settings.ROOT_DIR, 'dummy_app2/templates'
               ) not in paths, 'should have the template folder for DUMMY_APP1'
def i_have_a_template_folder_on_my_path():
    assert abs(
        settings.ROOT_DIR,
        'templates') in paths, 'should have a template folder on ROOT_DIR'
def test_i_have_installed_apps_template_folders_on_my_path():
    assert abs(settings.ROOT_DIR, "dummy_app1/templates") in paths, "should have the template folder for DUMMY_APP1"
    assert abs(settings.ROOT_DIR, "dummy_app2/templates") not in paths, "should have the template folder for DUMMY_APP1"
def i_have_a_template_folder_on_my_path():
    assert abs(settings.ROOT_DIR, "templates") in paths, "should have a template folder on ROOT_DIR"