Exemplo n.º 1
0
    def test_given_class_which_implements_file_test_as_true_WHEN_call_get_data_for_product_THEN_test_is_checked(self):
        from cis.data_io.products.AProduct import AProduct
        global check
        check = False

        class MyTestProductTestFileTypeTrue(AProduct):
            # Ensure this doesn't get picked up as a genuine product (when running integration tests)
            priority = -1

            def create_data_object(self, filenames, variable):
                pass

            def create_coords(self, filenames):
                pass

            def get_file_signature(self):
                return [r'.*\.endingtrue']

            def get_file_type_error(self, filesname):
                global check
                check = True
                return None

        get_coordinates(["file.endingtrue"])
        assert_that(check, is_(True), "File type check was called")
Exemplo n.º 2
0
    def test_given_class_which_implements_file_test_as_true_WHEN_call_get_data_for_product_THEN_test_is_checked(
            self):
        from cis.data_io.products.AProduct import AProduct
        global check
        check = False

        class MyTestProductTestFileTypeTrue(AProduct):
            # Ensure this doesn't get picked up as a genuine product (when running integration tests)
            priority = -1

            def create_data_object(self, filenames, variable):
                pass

            def create_coords(self, filenames):
                pass

            def get_file_signature(self):
                return [r'.*\.endingtrue']

            def get_file_type_error(self, filesname):
                global check
                check = True
                return None

        get_coordinates(["file.endingtrue"])
        assert_that(check, is_(True), "File type check was called")
Exemplo n.º 3
0
    def test_given_cls_which_implements_file_test_as_false_WHEN_call_get_data_for_product_THEN_cls_no_found_error(self):
        from cis.data_io.products.AProduct import AProduct

        class MyTestProduct(AProduct):
            # Ensure this doesn't get picked up as a genuine product (when running integration tests)
            priority = -1

            def create_data_object(self, filenames, variable):
                pass

            def create_coords(self, filenames):
                pass

            def get_file_signature(self):
                return [r'.*\.ending']

            def get_file_type_error(self, filesname):
                return ["Not correct type"]

        get_coordinates(["file.ending"])
Exemplo n.º 4
0
    def test_given_cls_which_implements_file_test_as_false_WHEN_call_get_data_for_product_THEN_cls_no_found_error(
            self):
        from cis.data_io.products.AProduct import AProduct

        class MyTestProduct(AProduct):
            # Ensure this doesn't get picked up as a genuine product (when running integration tests)
            priority = -1

            def create_data_object(self, filenames, variable):
                pass

            def create_coords(self, filenames):
                pass

            def get_file_signature(self):
                return [r'.*\.ending']

            def get_file_type_error(self, filesname):
                return ["Not correct type"]

        get_coordinates(["file.ending"])