Skip to content
Permalink
Browse files

Adding more tests around generating correct colours given outcome

  • Loading branch information
darrenburns committed Jan 19, 2020
1 parent fe71d86 commit 7f43adcd2288fb1e8d97d3867e61fb7ef1d6ad7e
Showing with 9 additions and 1 deletion.
  1. +9 −1 tests/test_util.py
@@ -1,7 +1,7 @@
from tests.test_suite import example_test
from ward import expect, test, using, fixture
from ward.testing import TestOutcome, TestResult, each
from ward.util import ExitCode, get_exit_code, truncate
from ward.util import ExitCode, get_exit_code, truncate, outcome_to_colour


@test(
@@ -48,3 +48,11 @@ def _(
):
result = truncate(input, num_chars)
expect(result).equals(expected)


@test("outcome_to_colour({outcome}) returns '{colour}'")
def _(
outcome=each(TestOutcome.PASS, TestOutcome.SKIP, TestOutcome.FAIL, TestOutcome.XFAIL, TestOutcome.XPASS),
colour=each("green", "blue", "red", "magenta", "yellow"),
):
expect(outcome_to_colour(outcome)).equals(colour)

0 comments on commit 7f43adc

Please sign in to comment.
You can’t perform that action at this time.