Esempio n. 1
0
    def test_scenario6(self):
        """
            Scenario: Sucessfully deleting a source in a time range:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I store the source id as lower
                And I create a BigML source from file "<data>" storing results in "<output_dir2>"
                And I check that the source exists
                And I store the source id as reference
                And I create a BigML source from file "<data>" storing results in "<output_dir3>"
                And I check that the source has been created
                And I store the source id as upper
                And I delete the source using --older-than and --newer-than storing results in "<output_dir>"
                Then I check that the reference source doesn't exist

                Examples:
                | data               | output_dir | output_dir2 | output_dir3
                | ../data/iris.csv   | ./scenario_del_6 | ./scenario_del_6_2 | ./scenario_del_6_3
        """
        print self.test_scenario6.__doc__
        examples = [["data/iris.csv", "scenario_del_6", "scenario_del_6_2", "scenario_del_6_3"]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which="lower")
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[2])
            test_delete.i_check_source_exists(self)
            test_delete.i_store_source_id_as_bound(self, which="reference")
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[3])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which="upper")
            test_delete.i_delete_source_older_newer(self, output_dir=example[3])
            test_delete.i_check_source_does_not_exist(self, source_id=world.source_reference)
Esempio n. 2
0
    def test_scenario9(self):
        """
            Scenario: Sucessfully deleting resources in a time range and with a tag:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I store the source id as lower
                And I create a BigML source from file "<data>" with tag "<tag1>" storing results in "<output_dir>"
                And I check that the source exists
                And I create a BigML dataset from the source with tag "<tag1>" storing results in "<output_dir2>"
                And I check that the dataset exists
                And I delete the resources using --newer-than and --all-tag "<tag1>" storing results in "<output_dir3>"
                Then I check that the source doesn't exist
                And I check that the dataset doesn't exist

                Examples:
                | data               | output_dir       | tag1 | output_dir2       | output_dir3
                | ../data/iris.csv   | ./scenario_del_9 | my_tag1 | ./scenario_del_9_2  | ./scenario_del_9_3
        """
        print self.test_scenario9.__doc__
        examples = [["data/iris.csv", "scenario_del_9", "my_tag1", "scenario_del_9_2", "scenario_del_9_3"]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which="lower")
            test_delete.i_create_source_from_file_with_tag(self, data=example[0], tag=example[2], output_dir=example[3])
            test_delete.i_check_source_exists(self)
            test_delete.i_store_source_id_as_bound(self, which="reference")
            test_delete.i_create_dataset_from_source_with_tag(self, tag=example[2], output_dir=example[4])
            test_delete.i_check_dataset_exists(self)
            test_delete.i_delete_resources_newer_and_tag(self, tag=example[2], output_dir=example[1])
            test_delete.i_check_source_does_not_exist(self, source_id=world.source_reference)
            test_delete.i_check_dataset_does_not_exist(self, dataset_id=world.dataset)
            test_delete.i_check_source_exists_by_id(self, source_id=world.source_lower)
Esempio n. 3
0
    def test_scenario8(self):
        """
            Scenario: Sucessfully deleting a source in a time range and with a tag:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I store the source id as lower
                And I create a BigML source from file "<data>" with tag "<tag1>" storing results in "<output_dir>"
                And I check that the source exists
                And I store the source id as reference
                And I create a BigML source from file "<data>" with tag "<tag2>" storing results in "<output_dir2>"
                And I check that the source has been created
                And I store the source id as upper
                And I delete the source using --newer-than and --source-tag "<tag1>" storing results in "<output_dir3>"
                Then I check that the reference source doesn't exist
                And I check that the upper source exists

                Examples:
                | data               | output_dir       | tag1    | tag2 | output_dir2       | output_dir3
                | ../data/iris.csv   | ./scenario_del_8 | my_tag1 | my_tag2 | ./scenario_del_8_2 | ./scenario_del_8_3
        """
        print self.test_scenario8.__doc__
        examples = [[
            'data/iris.csv', 'scenario_del_8', 'my_tag1', 'my_tag2',
            'scenario_del_8_2', 'scenario_del_8_3'
        ]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which='lower')
            test_delete.i_create_source_from_file_with_tag(
                self, data=example[0], tag=example[2], output_dir=example[4])
            test_delete.i_check_source_exists(self)
            test_delete.i_store_source_id_as_bound(self, which='reference')
            test_delete.i_create_source_from_file_with_tag(
                self, data=example[0], tag=example[3], output_dir=example[5])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which='upper')
            test_delete.i_delete_source_newer_and_tag(self,
                                                      tag=example[2],
                                                      output_dir=example[1])
            test_delete.i_check_source_does_not_exist(
                self, source_id=world.source_reference)
            test_delete.i_check_source_exists_by_id(
                self, source_id=world.source_upper)
Esempio n. 4
0
    def test_scenario6(self):
        """
            Scenario: Sucessfully deleting a source in a time range:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I store the source id as lower
                And I create a BigML source from file "<data>" storing results in "<output_dir2>"
                And I check that the source exists
                And I store the source id as reference
                And I create a BigML source from file "<data>" storing results in "<output_dir3>"
                And I check that the source has been created
                And I store the source id as upper
                And I delete the source using --older-than and --newer-than storing results in "<output_dir>"
                Then I check that the reference source doesn't exist

                Examples:
                | data               | output_dir | output_dir2 | output_dir3
                | ../data/iris.csv   | ./scenario_del_6 | ./scenario_del_6_2 | ./scenario_del_6_3
        """
        print self.test_scenario6.__doc__
        examples = [[
            'data/iris.csv', 'scenario_del_6', 'scenario_del_6_2',
            'scenario_del_6_3'
        ]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which='lower')
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[2])
            test_delete.i_check_source_exists(self)
            test_delete.i_store_source_id_as_bound(self, which='reference')
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[3])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which='upper')
            test_delete.i_delete_source_older_newer(self,
                                                    output_dir=example[3])
            test_delete.i_check_source_does_not_exist(
                self, source_id=world.source_reference)
Esempio n. 5
0
    def test_scenario2(self):
        """
            Scenario: Failing deleting a source by id when --dry-run is used:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I delete the source by id using --ids and --dry-run storing results in "<output_dir>"
                Then I check that the source exists

                Examples:
                | data               | output_dir       |
                | ../data/iris.csv   | ./scenario_del_2 |
        """
        print self.test_scenario2.__doc__
        examples = [["data/iris.csv", "scenario_del_2"]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_delete_source_by_ids_dry(self, output_dir=example[1])
            test_delete.i_check_source_exists(self)
Esempio n. 6
0
    def test_scenario1(self):
        """
            Scenario: Successfully deleting a source by id:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source exists
                And I delete the source by id using --ids storing results in "<output_dir>"
                Then I check that the source doesn't exist

                Examples:
                | data               | output_dir       |
                | ../data/iris.csv   | ./scenario_del_1 |
        """
        print self.test_scenario1.__doc__
        examples = [["data/iris.csv", "scenario_del_1"]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[1])
            test_delete.i_check_source_exists(self)
            test_delete.i_delete_source_by_ids(self, output_dir=example[1])
            test_delete.i_check_source_does_not_exist(self, source_id=None)
Esempio n. 7
0
    def test_scenario5(self):
        """
            Scenario: Failing deleting a source from a file when a different resource_types is used:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I delete the source by id using --from-file, the source file and --resource-types "<resource_types>" storing results in "<output_dir>"
                Then I check that the source exists

                Examples:
                | data               | output_dir       | resource_types
                | ../data/iris.csv   | ./scenario_del_5 | dataset,model
        """
        print self.test_scenario5.__doc__
        examples = [["data/iris.csv", "scenario_del_5", "dataset,model"]]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_delete_source_by_file_filtered(self, resource_types=example[2], output_dir=example[1])
            test_delete.i_check_source_exists(self)
Esempio n. 8
0
    def test_scenario2(self):
        """
            Scenario: Failing deleting a source by id when --dry-run is used:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I delete the source by id using --ids and --dry-run storing results in "<output_dir>"
                Then I check that the source exists

                Examples:
                | data               | output_dir       |
                | ../data/iris.csv   | ./scenario_del_2 |
        """
        print self.test_scenario2.__doc__
        examples = [['data/iris.csv', 'scenario_del_2']]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_delete_source_by_ids_dry(self, output_dir=example[1])
            test_delete.i_check_source_exists(self)
Esempio n. 9
0
    def test_scenario1(self):
        """
            Scenario: Successfully deleting a source by id:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source exists
                And I delete the source by id using --ids storing results in "<output_dir>"
                Then I check that the source doesn't exist

                Examples:
                | data               | output_dir       |
                | ../data/iris.csv   | ./scenario_del_1 |
        """
        print self.test_scenario1.__doc__
        examples = [['data/iris.csv', 'scenario_del_1']]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[1])
            test_delete.i_check_source_exists(self)
            test_delete.i_delete_source_by_ids(self, output_dir=example[1])
            test_delete.i_check_source_does_not_exist(self, source_id=None)
Esempio n. 10
0
    def test_scenario5(self):
        """
            Scenario: Failing deleting a source from a file when a different resource_types is used:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I delete the source by id using --from-file, the source file and --resource-types "<resource_types>" storing results in "<output_dir>"
                Then I check that the source exists

                Examples:
                | data               | output_dir       | resource_types
                | ../data/iris.csv   | ./scenario_del_5 | dataset,model
        """
        print self.test_scenario5.__doc__
        examples = [['data/iris.csv', 'scenario_del_5', 'dataset,model']]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self,
                                                  data=example[0],
                                                  output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_delete_source_by_file_filtered(
                self, resource_types=example[2], output_dir=example[1])
            test_delete.i_check_source_exists(self)
Esempio n. 11
0
    def test_scenario8(self):
        """
            Scenario: Sucessfully deleting a source in a time range and with a tag:
                Given I create a BigML source from file "<data>" storing results in "<output_dir>"
                And I check that the source has been created
                And I store the source id as lower
                And I create a BigML source from file "<data>" with tag "<tag1>" storing results in "<output_dir>"
                And I check that the source exists
                And I store the source id as reference
                And I create a BigML source from file "<data>" with tag "<tag2>" storing results in "<output_dir2>"
                And I check that the source has been created
                And I store the source id as upper
                And I delete the source using --newer-than and --source-tag "<tag1>" storing results in "<output_dir3>"
                Then I check that the reference source doesn't exist
                And I check that the upper source exists

                Examples:
                | data               | output_dir       | tag1    | tag2 | output_dir2       | output_dir3
                | ../data/iris.csv   | ./scenario_del_8 | my_tag1 | my_tag2 | ./scenario_del_8_2 | ./scenario_del_8_3
        """
        print self.test_scenario8.__doc__
        examples = [
            ['data/iris.csv', 'scenario_del_8', 'my_tag1', 'my_tag2', 'scenario_del_8_2', 'scenario_del_8_3']]
        for example in examples:
            print "\nTesting with:\n", example
            test_delete.i_create_source_from_file(self, data=example[0], output_dir=example[1])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which='lower')
            test_delete.i_create_source_from_file_with_tag(self, data=example[0], tag=example[2], output_dir=example[4])
            test_delete.i_check_source_exists(self)
            test_delete.i_store_source_id_as_bound(self, which='reference')
            test_delete.i_create_source_from_file_with_tag(self, data=example[0], tag=example[3], output_dir=example[5])
            test_pred.i_check_create_source(self)
            test_delete.i_store_source_id_as_bound(self, which='upper')
            test_delete.i_delete_source_newer_and_tag(self, tag=example[2], output_dir=example[1])
            test_delete.i_check_source_does_not_exist(self, source_id=world.source_reference)
            test_delete.i_check_source_exists_by_id(self, source_id=world.source_upper)