import pytest
import hana
import hana.plugins.file_loader
import hana.plugins.file_writer

#TODO: test absolute paths
#TODO: test relative paths
def test_validation():
    with pytest.raises(hana.plugins.file_loader.SourceDirectoryError):
        b = hana.Hana()
        b.plugin(hana.plugins.file_loader.FileLoader(source_path='nonexistent_directory'))
        b.build()

def test_simple():
    b = hana.Hana()

    b.plugin(hana.plugins.file_loader.FileLoader(source_path='test/simple'))
    b.plugin(hana.plugins.file_writer.FileWriter(deploy_path='test/out'))

    b.build()

def test_plugins():
    plugin_executed = {}

    def plugin(files, hana):
        plugin_executed['executed'] = True

    b = hana.Hana()
    b.plugin(plugin)
    b.build()

    assert(plugin_executed)


c532030c092bea2536387767e4df02b77d45509a
<mask token>


def test_validation():
    with pytest.raises(hana.plugins.file_loader.SourceDirectoryError):
        b = hana.Hana()
        b.plugin(hana.plugins.file_loader.FileLoader(source_path=
            'nonexistent_directory'))
        b.build()


<mask token>

<mask token>


def test_validation():
    with pytest.raises(hana.plugins.file_loader.SourceDirectoryError):
        b = hana.Hana()
        b.plugin(hana.plugins.file_loader.FileLoader(source_path=
            'nonexistent_directory'))
        b.build()


def test_simple():
    b = hana.Hana()
    b.plugin(hana.plugins.file_loader.FileLoader(source_path='test/simple'))
    b.plugin(hana.plugins.file_writer.FileWriter(deploy_path='test/out'))
    b.build()


<mask token>

<mask token>


def test_validation():
    with pytest.raises(hana.plugins.file_loader.SourceDirectoryError):
        b = hana.Hana()
        b.plugin(hana.plugins.file_loader.FileLoader(source_path=
            'nonexistent_directory'))
        b.build()


def test_simple():
    b = hana.Hana()
    b.plugin(hana.plugins.file_loader.FileLoader(source_path='test/simple'))
    b.plugin(hana.plugins.file_writer.FileWriter(deploy_path='test/out'))
    b.build()


def test_plugins():
    plugin_executed = {}

    def plugin(files, hana):
        plugin_executed['executed'] = True
    b = hana.Hana()
    b.plugin(plugin)
    b.build()
    assert plugin_executed

import pytest
import hana
import hana.plugins.file_loader
import hana.plugins.file_writer


def test_validation():
    with pytest.raises(hana.plugins.file_loader.SourceDirectoryError):
        b = hana.Hana()
        b.plugin(hana.plugins.file_loader.FileLoader(source_path=
            'nonexistent_directory'))
        b.build()


def test_simple():
    b = hana.Hana()
    b.plugin(hana.plugins.file_loader.FileLoader(source_path='test/simple'))
    b.plugin(hana.plugins.file_writer.FileWriter(deploy_path='test/out'))
    b.build()


def test_plugins():
    plugin_executed = {}

    def plugin(files, hana):
        plugin_executed['executed'] = True
    b = hana.Hana()
    b.plugin(plugin)
    b.build()
    assert plugin_executed

import pytest
import hana
import hana.plugins.file_loader
import hana.plugins.file_writer

#TODO: test absolute paths
#TODO: test relative paths
def test_validation():
    with pytest.raises(hana.plugins.file_loader.SourceDirectoryError):
        b = hana.Hana()
        b.plugin(hana.plugins.file_loader.FileLoader(source_path='nonexistent_directory'))
        b.build()

def test_simple():
    b = hana.Hana()

    b.plugin(hana.plugins.file_loader.FileLoader(source_path='test/simple'))
    b.plugin(hana.plugins.file_writer.FileWriter(deploy_path='test/out'))

    b.build()

def test_plugins():
    plugin_executed = {}

    def plugin(files, hana):
        plugin_executed['executed'] = True

    b = hana.Hana()
    b.plugin(plugin)
    b.build()

    assert(plugin_executed)

