Пример #1
0
def test_empty_palette():
    """Create a palette without components."""
    palette = Palette()

    assert len(palette) == 0
    assert list(palette.list()) == []
    assert list(palette.keys()) == []
    assert palette.uses() == []
    assert palette.provides() == []

    providers = palette.find_provider("air__temperature")
    assert providers == []

    users = palette.find_user("air__temperature")
    assert users == []

    connections = palette.find_connections()
    assert connections == {}
Пример #2
0
def test_empty_palette():
    """Create a palette without components."""
    palette = Palette()

    assert len(palette) == 0
    assert list(palette.list()) == []
    assert list(palette.keys()) == []
    assert palette.uses() == []
    assert palette.provides() == []

    providers = palette.find_provider("air__temperature")
    assert providers == []

    users = palette.find_user("air__temperature")
    assert users == []

    connections = palette.find_connections()
    assert connections == {}
Пример #3
0
def test_empty_palette():
    """Create a palette without components."""
    palette = Palette()

    assert_equal(len(palette), 0)
    assert_equal(list(palette.list()), [])
    assert_equal(list(palette.keys()), [])
    assert_equal(palette.uses(), [])
    assert_equal(palette.provides(), [])

    providers = palette.find_provider('air__temperature')
    assert_equal(providers, [])

    users = palette.find_user('air__temperature')
    assert_equal(users, [])

    connections = palette.find_connections()
    assert_dict_equal(connections, {})
Пример #4
0
    def test_find_users(self):
        palette = Palette(sample=Sample1)

        users = palette.find_user('air__temperature')
        self.assertEqual(users, ['sample'])
Пример #5
0
    def test_find_users(self):
        palette = Palette(one=Sample1, two=Sample2)

        users = palette.find_user('air__temperature')
        self.assertListEqual(['one'], users)
Пример #6
0
def test_1_component_find_users():
    palette = Palette(sample=Sample1)

    users = palette.find_user('air__temperature')
    assert_equal(users, ['sample'])
Пример #7
0
def test_2_components_find_users():
    palette = Palette(one=Sample1, two=Sample2)

    users = palette.find_user('air__temperature')
    assert_list_equal(['one'], users)
Пример #8
0
    def test_find_users(self):
        palette = Palette(sample=Sample1)

        users = palette.find_user('air__temperature')
        self.assertEqual(users, ['sample'])
Пример #9
0
    def test_find_users(self):
        palette = Palette(one=Sample1, two=Sample2)

        users = palette.find_user('air__temperature')
        self.assertListEqual(['one'], users)
Пример #10
0
def test_2_components_find_users():
    palette = Palette(one=Sample1, two=Sample2)

    users = palette.find_user("air__temperature")
    assert ["one"] == users
Пример #11
0
def test_1_component_find_users():
    palette = Palette(sample=Sample1)

    users = palette.find_user("air__temperature")
    assert users == ["sample"]
Пример #12
0
def test_2_components_find_users():
    palette = Palette(one=Sample1, two=Sample2)

    users = palette.find_user("air__temperature")
    assert ["one"] == users
Пример #13
0
def test_1_component_find_users():
    palette = Palette(sample=Sample1)

    users = palette.find_user("air__temperature")
    assert users == ["sample"]