Commit 68339b19 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

tests/testutils/runcli.py: Make get_element_states() take a list of targets

Instead of a single target, we can always provide a single target
in a list.
parent 3a6e953f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind, amount):
        last_element_name = element_name

    # Assert that a fetch is needed
    states = cli.get_element_states(project, last_element_name)
    states = cli.get_element_states(project, [last_element_name])
    for element_name in element_names:
        assert states[element_name] == 'no reference'

@@ -143,7 +143,7 @@ def test_track_recurse(cli, tmpdir, datafiles, kind, amount):
    result.assert_success()

    # Assert that the base is buildable and the rest are waiting
    states = cli.get_element_states(project, last_element_name)
    states = cli.get_element_states(project, [last_element_name])
    for element_name in element_names:
        if element_name == element_names[0]:
            assert states[element_name] == 'buildable'
+2 −3
Original line number Diff line number Diff line
@@ -398,13 +398,12 @@ class Cli():
    #
    # Returns a dictionary with the element names as keys
    #
    def get_element_states(self, project, target, deps='all'):
    def get_element_states(self, project, targets, deps='all'):
        result = self.run(project=project, silent=True, args=[
            'show',
            '--deps', deps,
            '--format', '%{name}||%{state}',
            target
        ])
        ] + targets)
        result.assert_success()
        lines = result.output.splitlines()
        states = {}