# -*- coding: utf-8 -*-

"""
    radish
    ~~~~~~

    Behavior Driven Development tool for Python - the root from red to green

    Copyright: MIT, Timo Furrer <tuxtimo@gmail.com>
"""

import pytest

import radish.utils as utils


@pytest.mark.parametrize('basedirs, expected_basedirs', [
    (['foo', 'bar'], ['foo', 'bar']),
    (['foo:bar', 'foobar'], ['foo', 'bar', 'foobar']),
    (['foo:bar', 'foobar', 'one:two:three'],
        ['foo', 'bar', 'foobar', 'one', 'two', 'three']),
    (['foo:', ':bar'], ['foo', 'bar'])
])
def test_flattened_basedirs(basedirs, expected_basedirs):
    """
    Test flatten basedirs
    """
    # given & when
    actual_basedirs = utils.flattened_basedirs(basedirs)

    # then
    assert actual_basedirs == expected_basedirs

@@ -750,16 +750,558 @@
 pected_basedirs%0A
+%0A%0Adef test_make_unique_obj_list():%0A    %22%22%22%0A    Test filter list by propertyName%0A    %22%22%22%0A    object_list = %5B type('SomeObjectClass', (object,), %7B'propertyName' : '1'%7D),%0A                    type('SomeObjectClass', (object,), %7B'propertyName' : '2'%7D),%0A                    type('SomeObjectClass', (object,), %7B'propertyName' : '1'%7D),%0A    %5D%0A%0A    value_list = utils.make_unique_obj_list(object_list, lambda x: x.propertyName)%0A    value_list = list(map(lambda x: x.propertyName, value_list))%0A    value_list.sort()%0A%0A    assert value_list == %5B'1', '2'%5D%0A

Add a test for utils.make_unique_obj_list