Esempio n. 1
0
    def test_prior_dataset(self):
        """test in prior dataset provided by Instacart"""
        test_path = os.path.join(self.tests_path, "test_prior_dataset")
        order_products_path = os.path.join(test_path,
                                           "input/order_products.csv")
        products_path = os.path.join(test_path, "input/products.csv")
        correct_report_path = os.path.join(test_path, "output/report.csv")

        analyze_purchases(order_products_path, products_path,
                          self.temp_report_path)

        self.assertMultiLineEqual(read_file(self.temp_report_path),
                                  read_file(correct_report_path),
                                  "report file is not equal to the answer")
Esempio n. 2
0
    def test_input_extra_header(self):
        """test input files have a new column"""
        test_path = os.path.join(self.tests_path, "test_input_extra_header")
        order_products_path = os.path.join(test_path,
                                           "input/order_products.csv")
        products_path = os.path.join(test_path, "input/products.csv")
        correct_report_path = os.path.join(test_path, "output/report.csv")

        analyze_purchases(order_products_path, products_path,
                          self.temp_report_path)

        self.assertMultiLineEqual(read_file(self.temp_report_path),
                                  read_file(correct_report_path),
                                  "report file is not equal to the answer")