@with_tempdir
    def test_it_runs(self, tempdir):
        builder_path = os.path.join(tempdir, 'test.builder')
        scenario = {
            'replicas': 3, 'part_power': 8, 'random_seed': 123, 'overload': 0,
            'rounds': [[['add', 'r1z2-3.4.5.6:7/sda8', 100],
                        ['add', 'z2-3.4.5.6:7/sda9', 200],
                        ['add', 'z2-3.4.5.6:7/sda10', 200],
                        ['add', 'z2-3.4.5.6:7/sda11', 200]],
                       [['set_weight', 0, 150]],
                       [['remove', 1]],
                       [['save', builder_path]]]}
        parsed = parse_scenario(json.dumps(scenario))

        fake_stdout = StringIO()
        with mock.patch('sys.stdout', fake_stdout):
            run_scenario(parsed)

        # Just test that it produced some output as it ran; the fact that
        # this doesn't crash and produces output that resembles something
        # useful is good enough.
        self.assertTrue(fake_stdout.getvalue() in 'Rebalance')
        self.assertTrue(os.path.exists(builder_path))
dataset/ETHPy150Open openstack/swift/test/unit/cli/test_ring_builder_analyzer.py/TestRunScenario.test_it_runs/swapped operands of `in`