Exemplo n.º 1
0
from hitchstory import StoryCollection, BaseEngine, no_stacktrace_for, validate
from hitchstory import GivenDefinition, GivenProperty, InfoDefinition, InfoProperty
from hitchstory import HitchStoryException
from hitchrun import expected
from strictyaml import Str, Map, MapPattern, Int, Bool, Optional, load
from pathquery import pathquery
from hitchrun import DIR
from hitchrunpy import ExamplePythonCode, HitchRunPyException
from templex import Templex
import hitchpylibrarytoolkit
import dirtemplate


toolkit = hitchpylibrarytoolkit.ProjectToolkit(
    "commandlib",
    DIR,
)


class Engine(BaseEngine):
    """Python engine for running tests."""

    given_definition = GivenDefinition(
        scripts=GivenProperty(MapPattern(Str(), Str())),
        python_version=GivenProperty(Str()),
        pexpect_version=GivenProperty(Str()),
        icommandlib_version=GivenProperty(Str()),
        setup=GivenProperty(Str()),
        files=GivenProperty(MapPattern(Str(), Str())),
        code=GivenProperty(Str()),
    )
Exemplo n.º 2
0
from hitchrun import DIR
from hitchrun.decorators import ignore_ctrlc
from hitchrunpy import (
    ExamplePythonCode,
    ExpectedExceptionMessageWasDifferent,
)
import hitchbuildpy
import dirtemplate
import signal
import hitchpylibrarytoolkit
from templex import Templex

PROJECT_NAME = "seleniumdirector"

toolkit = hitchpylibrarytoolkit.ProjectToolkit(
    "seleniumdirector",
    DIR,
)


def project_build(paths, python_version, selenium_version=None):
    pylibrary = (hitchbuildpy.PyLibrary(
        name="py{0}".format(python_version),
        base_python=hitchbuildpy.PyenvBuild(python_version).with_build_path(
            paths.share),
        module_name="seleniumdirector",
        library_src=paths.project,
    ).with_requirementstxt(paths.key /
                           "debugrequirements.txt").with_build_path(paths.gen))

    if selenium_version is not None:
        pylibrary = pylibrary.with_packages(
Exemplo n.º 3
0
from hitchstory import HitchStoryException, StoryCollection
from hitchrun import expected
from commandlib import CommandError
from strictyaml import Str, Map, Bool, load
from pathquery import pathquery
from hitchrun import DIR
import dirtemplate
import hitchpylibrarytoolkit
from engine import Engine

PROJECT_NAME = "strictyaml"

toolkit = hitchpylibrarytoolkit.ProjectToolkit(
    "strictyaml",
    DIR,
)
"""
----------------------------
Non-runnable utility methods
---------------------------
"""


def _storybook(**settings):
    return StoryCollection(
        pathquery(DIR.key / "story").ext("story"), Engine(DIR, **settings))


def _current_version():
    return DIR.project.joinpath("VERSION").bytes().decode("utf8").rstrip()
Exemplo n.º 4
0
from hitchstory import HitchStoryException
from hitchrun import expected
from hitchrun import DIR
from engine import Engine
import hitchpylibrarytoolkit


toolkit = hitchpylibrarytoolkit.ProjectToolkit(
    "pylibrary",
    DIR,
    Engine,
)


@expected(HitchStoryException)
def bdd(*keywords):
    """Run single story."""
    toolkit.bdd(Engine(DIR), keywords)


@expected(HitchStoryException)
def regression():
    """
    Run regression testing - lint and then run all tests.
    """
    toolkit.regression(Engine(DIR))


def reformat():
    """
    Reformat using black and then relint.
Exemplo n.º 5
0
from hitchstory import HitchStoryException, StoryCollection
from hitchrun import expected
from commandlib import CommandError
from strictyaml import Str, Map, Bool, load
from pathquery import pathquery
from hitchrun import DIR
import dirtemplate
import hitchpylibrarytoolkit
from path import Path
from versionbullshit import get_versions
from engine import Engine
import json

toolkit = hitchpylibrarytoolkit.ProjectToolkit(
    "hitchchrome",
    DIR,
)


@expected(HitchStoryException)
def bdd(*keywords):
    """Run single story."""
    toolkit.bdd(Engine(toolkit.build), keywords)


@expected(HitchStoryException)
def regression():
    """Run all stories."""
    clean()
    toolkit.regression(Engine(toolkit.build))
Exemplo n.º 6
0
from commandlib import Command, CommandError
from hitchstory import StoryCollection, BaseEngine, HitchStoryException
from hitchrun import expected
from commandlib import Command
from strictyaml import Str, Map, Int, Optional
from pathquery import pathquery
from commandlib import python
from engine import Engine
from hitchrun import DIR
import hitchpylibrarytoolkit


toolkit = hitchpylibrarytoolkit.ProjectToolkit(
    "templex",
    DIR,
)

@expected(HitchStoryException)
def bdd(*keywords):
    """Run single story."""
    toolkit.bdd(Engine(toolkit.build), keywords)
    

@expected(HitchStoryException)
def regression():
    """Run all stories."""
    toolkit.regression(Engine(toolkit.build))

def deploy(version):
    """
    Deploy to pypi as specified version.