6b2efb9ddc577f16d90f07d80643dbace131214a,tests/data/test_heterogeneous_breadth_first_walker.py,TestSampledHeterogeneousBreadthFirstWalk,test_parameter_checking,#TestSampledHeterogeneousBreadthFirstWalk#,66

Before Change


        n_size = [1]
        seed = 1001

        with pytest.raises(ValueError):
            // nodes should be a list of node ids even for a single node
            bfw.run(
                nodes=None, n=n, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            bfw.run(nodes=0, n=n, n_size=n_size, graph_schema=graph_schema, seed=seed)
            // only list is acceptable type for nodes
            bfw.run(
                nodes=(1, 2), n=n, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            // n has to be positive integer
            bfw.run(
                nodes=nodes, n=-1, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            bfw.run(
                nodes=nodes, n=10.1, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            bfw.run(
                nodes=nodes, n=0, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            // n_size has to be list of positive integers
            bfw.run(nodes=nodes, n=n, n_size=0, graph_schema=graph_schema, seed=seed)
            bfw.run(nodes=nodes, n=n, n_size=[-5], graph_schema=graph_schema, seed=seed)
            bfw.run(
                nodes=nodes, n=-1, n_size=[2.4], graph_schema=graph_schema, seed=seed
            )
            bfw.run(
                nodes=nodes, n=n, n_size=(1, 2), graph_schema=graph_schema, seed=seed
            )
            // graph_schema must be None or GraphSchema type
            bfw.run(
                nodes=nodes, n=n, n_size=n_size, graph_schema="graph schema", seed=seed
            )
            bfw.run(nodes=nodes, n=n, n_size=n_size, graph_schema=9092, seed=seed)
            // seed must be positive integer or 0
            bfw.run(
                nodes=nodes, n=n, n_size=n_size, graph_schema=graph_schema, seed=-1235
            )
            bfw.run(
                nodes=nodes,
                n=n,
                n_size=n_size,
                graph_schema=graph_schema,
                seed=10.987665,
            )
            bfw.run(
                nodes=nodes,
                n=n,
                n_size=n_size,
                graph_schema=graph_schema,
                seed=-982.4746,
            )
            bfw.run(
                nodes=nodes,
                n=n,
                n_size=n_size,
                graph_schema=graph_schema,
                seed="don"t be random",
            )

        // If no root nodes are given, an empty list is returned which is not an error but I thought this method
        // is the best for checking this behaviour.
        nodes = []
        subgraph = bfw.run(
            nodes=nodes, n=n, n_size=n_size, graph_schema=graph_schema, seed=seed
        )

After Change


        n_size = [1]
        seed = 1001

        with pytest.raises(ValueError):
            // nodes should be a list of node ids even for a single node
            bfw.run(
                nodes=None, n=n, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
        with pytest.raises(ValueError):
            bfw.run(nodes=0, n=n, n_size=n_size, graph_schema=graph_schema, seed=seed)
        with pytest.raises(ValueError):
            // only list is acceptable type for nodes
            bfw.run(
                nodes=(1, 2), n=n, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            // n has to be positive integer
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=-1, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=10.1, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=0, n_size=n_size, graph_schema=graph_schema, seed=seed
            )
            // n_size has to be list of positive integers
        with pytest.raises(ValueError):
            bfw.run(nodes=nodes, n=n, n_size=0, graph_schema=graph_schema, seed=seed)
        with pytest.raises(ValueError):
            bfw.run(nodes=nodes, n=n, n_size=[-5], graph_schema=graph_schema, seed=seed)
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=-1, n_size=[2.4], graph_schema=graph_schema, seed=seed
            )
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=n, n_size=(1, 2), graph_schema=graph_schema, seed=seed
            )
            // graph_schema must be None or GraphSchema type
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=n, n_size=n_size, graph_schema="graph schema", seed=seed
            )
        with pytest.raises(ValueError):
            bfw.run(nodes=nodes, n=n, n_size=n_size, graph_schema=9092, seed=seed)
            // seed must be positive integer or 0
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes, n=n, n_size=n_size, graph_schema=graph_schema, seed=-1235
            )
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes,
                n=n,
                n_size=n_size,
                graph_schema=graph_schema,
                seed=10.987665,
            )
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes,
                n=n,
                n_size=n_size,
                graph_schema=graph_schema,
                seed=-982.4746,
            )
        with pytest.raises(ValueError):
            bfw.run(
                nodes=nodes,
                n=n,
                n_size=n_size,
                graph_schema=graph_schema,
                seed="don"t be random",
            )

        // If no root nodes are given, an empty list is returned which is not an error but I thought this method
        // is the best for checking this behaviour.
        nodes = []
        subgraph = bfw.run(
            nodes=nodes, n=n, n_size=n_size, graph_schema=graph_schema, seed=seed
        )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 58

Instances


Project Name: stellargraph/stellargraph
Commit Name: 6b2efb9ddc577f16d90f07d80643dbace131214a
Time: 2018-07-19
Author: pantelis.elinas@data61.csiro.au
File Name: tests/data/test_heterogeneous_breadth_first_walker.py
Class Name: TestSampledHeterogeneousBreadthFirstWalk
Method Name: test_parameter_checking


Project Name: stellargraph/stellargraph
Commit Name: 6b2efb9ddc577f16d90f07d80643dbace131214a
Time: 2018-07-19
Author: pantelis.elinas@data61.csiro.au
File Name: tests/data/test_heterogeneous_breadth_first_walker.py
Class Name: TestSampledHeterogeneousBreadthFirstWalk
Method Name: test_parameter_checking


Project Name: stellargraph/stellargraph
Commit Name: c53b03d88ba02fc261a9320f0304bd7e3e093121
Time: 2018-07-22
Author: pantelis.elinas@data61.csiro.au
File Name: tests/data/test_uniform_random_walker.py
Class Name: TestUniformRandomWalk
Method Name: test_parameter_checking


Project Name: stellargraph/stellargraph
Commit Name: 7b6dfe7d469d7b4a1ccf4692e82f7a0650f2df8e
Time: 2018-07-22
Author: pantelis.elinas@data61.csiro.au
File Name: tests/data/test_breadth_first_walker.py
Class Name: TestBreadthFirstWalk
Method Name: test_parameter_checking