Esempio n. 1
0
    def test_scenario7(self):
        """
            Scenario: Successfully building a centroid reify output in python
                Given I create a BigML centroid for "<input_data>" from a cluster with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the cluster has been created
                And I check that the centroid has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language | input_data
                | data/iris.csv | scenario_re7/reify.py | {"name": "my_centroid_name"}|../check_files/reify_anomaly.py | python | {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}
        """
        print self.test_scenario7.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re7/reify.py', {"name": "my_centroid_name"}, 'check_files/reify_centroid.py', 'python', {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_centroid(example[0],
                                       input_data=example[5],
                                       output=example[1],
                                       args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='centroid')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])
Esempio n. 2
0
    def test_scenario7(self):
        """
            Scenario: Successfully building a centroid reify output in python
                Given I create a BigML centroid for "<input_data>" from a cluster with data "<data>" and params "<params>"
                And I check that the source has been created
                And I check that the dataset has been created
                And I check that the cluster has been created
                And I check that the centroid has been created
                Then I create a reify output in "<output>" for "<language>"
                And the "<output>" file is like "<check_file>"

                Examples:
                | data | output | params |check_file | language | input_data
                | data/iris.csv | scenario_re7/reify.py | {"name": "my_centroid_name"}|../check_files/reify_anomaly.py | python | {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}
        """
        print self.test_scenario7.__doc__
        examples = [
            ['data/iris.csv', 'scenario_re7/reify.py', {"name": "my_centroid_name"}, 'check_files/reify_centroid.py', 'python', {"petal length": 0.5, "sepal length": 1, "petal width": 0.5, "sepal width": 1, "species": "Iris-setosa"}]]

        for example in examples:
            print "\nTesting with:\n", example
            test_reify.create_centroid(example[0],
                                       input_data=example[5],
                                       output=example[1],
                                       args=example[2])
            test_reify.i_create_output(self, example[1], example[4],
                                       resource_type='centroid')
            test_reify.i_check_output_file(self, output=example[1],
                                           check_file=example[3])